Skip to content

feat: make default transaction target-tick offset remotely configurable - #679

Open
ahmed-tarek-salem wants to merge 4 commits into
developfrom
feat/remote-default-tick-offset
Open

feat: make default transaction target-tick offset remotely configurable#679
ahmed-tarek-salem wants to merge 4 commits into
developfrom
feat/remote-default-tick-offset

Conversation

@ahmed-tarek-salem

Copy link
Copy Markdown
Contributor

No description provided.

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.
@sallymoc

Copy link
Copy Markdown
Contributor

@ahmed-tarek-salem
Instead of mapping the remote value into the existing presets, I'd suggest adding an "Automatic" option as the default in the target-tick dropdown, whose value comes straight from the remote config.

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:

  • Automatic (+7) ← default
  • Current + 5
  • Current + 10
  • Current + 20
  • Current + 40
  • Manual Override

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants