Commit Graph
311 Commits
Author SHA1 Message Date
mika@stocksharp.com d90d4d7dda Validate the starting path for history data lookup
Return no history data for a missing starting path even when an ancestor contains a history data package.
2026-11-27 11:29:04 +03:00
mika@stocksharp.com b7745f34c1 Remove the transaction id storage
The protocol servers minted a transaction number of their own for every
client request and kept the pairing in an ITransactionIdStorage, one table
per connection. They now run each request under the number its client
gave it, so the storage, its in-memory and plain implementations and their
tests go.
2026-10-17 01:22:33 +03:00
mika@stocksharp.com 6e7a7dae22 Move instrument lookups and persistence to async
Instrument lookups, configuration, credentials, CSV entities, snapshots and
the alert processing service are read and written asynchronously; the
blocking synchronous forms are obsolete wrappers.

IAsyncPersistable replaces IPersistable: every type that saves and loads its
settings has LoadAsync and SaveAsync only, and nested objects are read with
GetValueAsync, LoadEntireAsync and LoadAllAsync. The synchronous Load and Save
are the obsolete Ecng extensions. The MultiConnect sample keeps IPersistable
for two settings classes, because the settings window of the published
StockSharp.Xaml package takes it.

Copies that were made by saving and loading are made asynchronously.
IMessageAdapter, IIndicator, the risk, commission, PnL, latency, slippage and
position managers, IStorageBuffer, Strategy, DiagramElement, ICompositionModel
and its nodes get CloneAsync and no longer implement ICloneable; Clone is an
obsolete blocking wrapper. A strategy copy keeps every security and portfolio
parameter the original holds. Messages, FieldMapping, BankDetails and
WithdrawInfo are copied in memory. A CommissionRuleMessage shares its rule and
the emulator takes a copy of it. Envelope gets a constructor that takes all
three lines and CreateAsync.

ToBruteForce and ToBruteForceRandom become ToBruteForceAsync and
ToBruteForceRandomAsync and return IAsyncEnumerable; BruteForceOptimizer runs
over it and takes the next strategy through an asynchronous delegate.

Diagram elements keep their own state in SaveState, OnLoading and LoadState.
Undo restores an in-memory snapshot; a chart element holds its series and
axes in it by reference. An alert rule keeps its value in the form a message
carries it. A diagram strategy applies composition settings that were loaded
before the composition was set in SetCompositionAsync or at the start, and
saves them while they wait.

Strategies get an OnStartedAsync hook; diagram strategies resolve securities,
underlyings and strikes before the start so value processing never looks up
instruments. Paths.Serialize, SerializeInvariant, AppStartSettings.TrySave,
ICredentialsProvider.Save, ISnapshotSerializer.Serialize and the composition
registry gain async forms.

ICredentialsProvider.Delete becomes DeleteAsync, so loading, saving and
deleting the credentials wait for one another. Paths.InstalledVersion and
AppNameWithVersion are obsolete in favour of GetInstalledVersionAsync and
GetAppNameWithVersionAsync.

A file is opened for writing only after the last cancellation check, because
opening it empties it; a cancelled read reports the cancellation instead of
an empty result. A snapshot flush that failed leaves what it took due for the
next one.

The indicator templates for C#, F# and Python override LoadAsync and
SaveAsync.
2026-10-04 11:28:17 +03:00
mika@stocksharp.com 5897f6c484 Roll back a credential save that never reached the file
DeleteAsync already put a removed account back when the write failed, so that a delete reported as done could not be undone by a restart. SaveAsync had no such guard: an account whose write threw stayed granted in memory while the file knew nothing of it. The rollback is now the same on both paths.
2026-09-14 18:22:26 +03:00
mika@stocksharp.com d9f1eb3949 Stabilize configuration alerts and generated resources 2026-09-13 18:03:23 +03:00
mika@stocksharp.com af74f1eab9 Move the shared MSBuild props into props/
Twelve common_*.props files sat in the repository root, mixed in with the
solutions and the READMEs. They are build configuration and now live in props/,
and every import that reaches them carries the folder: 59 imports across this
repository, Connectors and StockSharpApps, the F# analytics project included.

common_meta.props derived the repository location from its own directory, so it
now normalizes one level up. RepoGitHubPath and everything built on it -
RepoAppsPath, RepoWebPath, ConnectorsGitHubPath, ConnectorsAppsPath - evaluate
to exactly the paths they did before.

The folder is props/ and not build/, which .gitignore excludes.
2026-08-14 20:34:04 +03:00
mika@stocksharp.com 2b0963386a Localize StockSharp links on the canonical domain 2026-08-09 15:02:19 +03:00
mika@stocksharp.com dbf6d614db Drop ProjectGuid from the SDK-style projects
A leftover of the old project format: seven projects still carried a
ProjectGuid, and nothing reads it. The solutions are the XML format and name
their projects by path, so the identifiers were not referenced anywhere - and
the SDK does not need one. Where the element was the only thing in its
PropertyGroup the empty group goes with it.
2026-08-03 18:11:24 +03:00
mika@stocksharp.com 1b53ce754e Make the company path absolute for real
The previous attempt leaned on ToFullPathIfNeed, which does not do what its name
suggests: it expands the %Documents% variable and returns everything else
untouched. A bare "StockSharp" - what Path.Combine yields when GetFolderPath
answers with an empty string, as it does in a container with no HOME - passed
through it unchanged and stayed relative, so the paths tests went on failing.

Path.GetFullPath settles it against the current directory, which is where the
data was already going; now it is stated rather than implied. The %Documents%
expansion is kept, and its own empty result falls through to the same default
instead of throwing.
2026-07-31 21:08:29 +03:00
mika@stocksharp.com de94650b30 Keep the StockSharp paths absolute even where the OS names no documents folder
GetFolderPath answers with an empty string when the platform cannot name the
folder - a container with no HOME, which is what a CI runner usually is - and
Path.Combine then yielded a bare "StockSharp". Every path built from it inherited
that, so the data would land wherever the process happened to start rather than
in one known place.

Whatever the folder resolves to is now made absolute, which is what the rest of
the code already assumed.
2026-07-31 20:39:14 +03:00
mika@stocksharp.com a76333f52a Add ICurrentClientFetcher next to ICredentialsProvider
Configuration already owns the StockSharp-account credentials abstraction:
ICredentialsProvider loads, saves and deletes them. What it did not have is the
third operation - who is signed in right now, and with what token - which is the
one question the credentials dialog asks the web API.

Stating it here rather than in the UI library keeps the dependency pointing the
right way. The dialog does not need to know the shape of the web API; the caller,
which already knows it, supplies the implementation. And a consumer that wants to
answer that question without a WPF reference now can.

Not in Ecng, which was the other candidate: Ecng.Net's IOAuthProvider and
IOAuthToken are generic OAuth - a token by social id, with a value and an expiry.
This is not that. It answers with an email and an access token for OUR account,
and its salt is our own login handshake, not an OAuth notion. Ecng is shared by
projects that have no StockSharp account to ask about.
2026-07-30 20:51:54 +03:00
mika@stocksharp.com 2349060cd3 Paths.Serialize: create the target directory when it is missing
Serialize<T> wrote through IFileSystem.OpenWrite, which - like File.Open - does
not create missing parent folders, so serializing to a path inside a not-yet
created directory threw DirectoryNotFoundException. The installer hit this while
saving its app cache to ...\Documents\StockSharp\Installer\ before that folder
existed (the error was logged on every run and the cache never persisted).
Create the parent directory before opening the stream.
2026-06-03 20:04:50 +03:00
mika@stocksharp.com 8bfba0837b Fix InMemoryTransactionIdStorage stale session on reconnect
Get(persistable:true) used SafeAdd which returned the cached session
with old requestId mappings. When a client reconnects with the same
sessionId, CreateTransactionId throws "duplicated". Replace SafeAdd
with unconditional assignment to always create a fresh session.
2026-03-30 19:09:17 +03:00
mika@stocksharp.com 7076fc6e22 Remove common_target_standard*.props, migrate all projects to common_target_net.props
Inline netstandard2.0 target into common_target_source_generator.props (only Roslyn generators need it).
Delete common_target_standard.props and common_target_standard_net.props.
Migrate Configuration, Messages, Media, Media.Names, Localization to common_target_net.props.
2026-03-01 12:12:52 +03:00
mika@stocksharp.com 08cb6a2821 Extract .NET version into NetVer/NetTfm/NetOldTfm constants in common_versions.props 2026-02-28 13:01:32 +03:00
mika@stocksharp.com ab32485b23 Fix async stream disposal in DeserializeOrThrowAsync
Non-async method with using var stream returned ValueTask without await,
causing stream to be disposed before deserialization completed
(ObjectDisposedException on SafeFileHandle).
2026-02-25 10:26:12 +03:00
mikasoukhov ee12256888 Assembly. GetAdapters extension. 2026-01-27 13:16:44 +03:00
mikasoukhov 8b056ed55a Code cleanup. 2026-01-27 13:10:13 +03:00
mikasoukhov 388425f924 Small fixes. 2026-01-27 01:36:36 +03:00
mikasoukhov a496abbad7 prev commit fix 2026-01-14 19:22:34 +03:00
mikasoukhov 77284638a0 IPermissionCredentialsStorage uses async model. 2026-01-14 19:13:57 +03:00
mikasoukhov 3df7ed06c7 build fix. 2026-01-01 23:51:37 +03:00
mikasoukhov ca6d4de17c build fix. 2025-12-30 23:55:07 +03:00
mikasoukhov c186c3ac03 Code cleanup. 2025-12-27 17:08:50 +03:00
mikasoukhov 046d7a7225 mark Paths Serialize/Deserialize without IFileSystem as obsolete
Methods marked with [Obsolete("Use IFileSystem overload.")]:
- Serialize<T>(this T value, string filePath, bool bom)
- Deserialize<T>(this string filePath)
- DeserializeAsync<T>(this string filePath, CancellationToken)
- DeserializeOrThrow<T>(this string filePath)
- DeserializeOrThrowAsync<T>(this string filePath, CancellationToken)
2025-12-27 17:04:29 +03:00
mikasoukhov 7c1debf481 add IFileSystem support to FileCredentialsStorage with tests 2025-12-27 16:24:47 +03:00
mikasoukhov ad2f8bebff DefaultCredentialsProvider: add IFileSystem support
- Accept IFileSystem, credentialsFile, and companyPath in constructor
  with defaults for backward compatibility
- Replace direct File/Directory calls with IFileSystem methods
- Add comprehensive tests using MemoryFileSystem
2025-12-27 15:15:41 +03:00
mikasoukhov 414542d3da Code cleanup. 2025-12-26 03:17:08 +03:00
mikasoukhov 5709d73cd0 IFileSystem abstraction for storage classes.
- LocalMarketDataDrive
- SnapshotRegistry
- DriveCache
- CsvEntityRegistry
- ICandlePatternProvider
- IExtendedInfoStorage
- INativeIdStorage
- ISecurityMappingStorage
- IPortfolioMessageAdapterProvider
- ISecurityMessageAdapterProvider
- InvariantCultureSerializer
- Paths
2025-12-26 03:14:30 +03:00
mikasoukhov e7dfee8f81 Fix commit 4892cc46b4 2025-12-18 18:03:41 +03:00
mikasoukhov dade40f5ff NuGet v7.0.1 2025-12-16 23:19:00 +03:00
mikasoukhov 87f7974a23 Fix commit 0f17bf9bd2 2025-12-16 20:28:09 +03:00
mikasoukhov df1bbb0c9c IAsyncMessageAdapter merged with IMessageAdapter. 2025-12-07 19:23:39 +03:00
mikasoukhov e44b0c4825 Lock usage. 2025-11-30 12:32:50 +03:00
mikasoukhov f59ecedd60 Fix commit e649041e04 2025-11-22 20:14:00 +03:00
mikasoukhov b955452b59 Fix commit 143443b527 2025-11-13 10:32:32 +03:00
mikasoukhov 77f208b40a Fix commit f822fcbdf4 2025-11-06 16:45:05 +03:00
mikasoukhov f822fcbdf4 AppStartSettings. TimeZone 2025-11-06 16:25:10 +03:00
mikasoukhov 25e621a4cf DateTimeOffset -> DateTime UTC 2025-11-02 18:40:36 +03:00
mikasoukhov f3eb403795 IMessageAdapterProvider. CreateTransportAdapter uses IAsyncMessageAdapter. 2025-10-28 22:10:17 +03:00
mikasoukhov 1f8a063ede Code cleanup. 2025-10-24 20:51:04 +03:00
mikasoukhov 79b1cad769 Fix commit 4892cc46b4 2025-10-13 00:28:48 +03:00
mikasoukhov 35227ac9a3 Code cleanup. 2025-10-12 23:24:06 +03:00
mikasoukhov 0107fac8ea Fix commit 9bc61ab504 2025-10-12 20:41:51 +03:00
mikasoukhov 96d951041c SubscriptionConfig 2025-10-10 02:04:46 +03:00
mikasoukhov 4892cc46b4 IPermissionCredentialsStorage 2025-10-10 01:14:57 +03:00
mikasoukhov 9bc61ab504 ITransactionIdStorage 2025-10-10 01:14:41 +03:00
mikasoukhov 25dbd72667 MakeFullPath extension. 2025-10-10 01:14:25 +03:00
mikasoukhov 7490ab25d2 Paths. DeserializeWithMigration removed as obsolete. 2025-10-08 01:16:26 +03:00
mikasoukhov a9a6a164f0 FindAdapters extension. 2025-09-18 00:17:13 +03:00