feat: make default transaction target-tick offset remotely configurable - #679
feat: make default transaction target-tick offset remotely configurable#679ahmed-tarek-salem wants to merge 4 commits into
Conversation
Read `default_tick_offset` from the wallet-app static config (/wallet-app/config.json) via WalletContentStore and use it as the default tick lead time for new transactions, so it can be tuned remotely without an app release. The Send / Transfer / Release-rights screens pre-select the matching dropdown preset, and the WalletConnect path uses the value directly; both fall back to +5 when the config is absent or invalid.
The three send screens overwrite `targetTickType` in initState (from the remote-configured default), so the global's value was never observed. Inline `TargetTickTypeEnum.autoCurrentPlus5` in the field declarations and delete the mutable module-level default.
Resolve the offset once in WalletContentStore.defaultTargetTickType (round up to nearest preset) so the send screens no longer fall back to +5 on non-preset values, and remove the config model unit test.
|
@ahmed-tarek-salem My concern with the current approach is that the same config value ends up behaving differently depending on the path — the send screen rounds it up to a preset while the WalletConnect path uses it as-is — so one setting produces two different target ticks. It's also applied without an upper bound. With a single "Automatic" value used everywhere (plus a safe min/max fallback on the client), the behavior stays consistent across all paths and we avoid a bad/stale config value breaking transactions. It also means the remote value can be any number instead of being forced into the preset buckets. For the labels, I'd drop the "Automatically" prefix from the existing presets so they read cleaner, and show the resolved value on the new default option:
That keeps the options short and consistent, frees up "Automatic" for the new default, and lets the user see the actual lead time being applied. What do you think? |
Replaces the preset round-up with a new "Automatic" dropdown entry that
is the default and resolves to the exact remotely configured offset. The
send screens and the WalletConnect path now go through
WalletContentStore.offsetFor, so one config value produces the same
target tick everywhere and any value is honored — not just the
5/10/20/40 presets.
Relabels the dropdown per review: "Automatic (+10)" shows the offset
actually applied, and the presets drop the "Automatically:" prefix
("Current + 5"). Updates all eight locales.
No description provided.