Skip to content

feat: add global URL-Test lazy and tolerance settings#53

Closed
sayhi-captain wants to merge 1 commit into
SubBoost:mainfrom
sayhi-captain:feat/url-test-options
Closed

feat: add global URL-Test lazy and tolerance settings#53
sayhi-captain wants to merge 1 commit into
SubBoost:mainfrom
sayhi-captain:feat/url-test-options

Conversation

@sayhi-captain

Copy link
Copy Markdown

Summary

  • add optional global URL-Test settings for lazy and tolerance in advanced mode
  • preserve legacy defaults until the override is enabled: regular groups keep lazy: false, dialer groups keep lazy: true, and tolerance remains omitted
  • persist the settings through templates, drafts, auth handoff, saved subscriptions, and server-side regeneration

Testing

  • npm run lint
  • npm run test:unit (203 files, 1066 tests)
  • npm run check:local-app
  • manually verified the advanced-mode controls with lazy: true and tolerance: 50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab9e9a14ef

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +399 to +400
...(urlTestLazy !== undefined ? { urlTestLazy } : {}),
...(urlTestTolerance !== undefined ? { urlTestTolerance } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear saved URL-Test overrides when disabled

When editing an existing subscription that already has urlTestLazy/urlTestTolerance saved, disabling the new switch sets both store values to undefined, so these spreads omit them from the config payload. The local update path then merges the submitted config over currentSecrets.config (local/src/lib/subscription-service.ts:220 via normalizeSubscriptionConfigForPersistence's { ...existingConfig, ...submittedConfig }), so the old override values remain encrypted and server-side regeneration keeps using them. Send an explicit clearing value or otherwise delete the saved keys when the override is disabled.

Useful? React with 👍 / 👎.

Comment on lines +543 to +544
urlTestLazy:
typeof cfg.urlTestLazy === "boolean" ? (cfg.urlTestLazy as boolean) : state.urlTestLazy,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset missing URL-Test fields while loading subscriptions

When loading a saved subscription whose config omits these new optional fields, such as any preexisting subscription or one with the override disabled, this falls back to the current draft's urlTestLazy/urlTestTolerance instead of the legacy undefined state. If the user previously enabled global URL-Test settings, opening such a subscription silently applies those settings to its generated YAML and subsequent save. Missing fields should hydrate as undefined rather than inheriting the previous screen state.

Useful? React with 👍 / 👎.

Comment on lines +175 to +176
urlTestLazy:
typeof config.urlTestLazy === "boolean" ? config.urlTestLazy : state.urlTestLazy,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset URL-Test overrides when applying templates

When applying a built-in or legacy template that omits the new optional URL-Test fields, this preserves whatever override is currently in the editor instead of reverting to the template's legacy behavior. For example, after enabling urlTestLazy/urlTestTolerance, applying a default template still leaves those overrides in the generated YAML even though the template config does not specify them. Missing template fields should clear these optional overrides rather than inherit stale state.

Useful? React with 👍 / 👎.

Comment on lines +177 to +180
urlTestTolerance:
typeof config.urlTestTolerance === "number"
? config.urlTestTolerance
: state.urlTestTolerance,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate template URL-Test tolerance before applying

This accepts any numeric urlTestTolerance from a loaded template, while the template validator and other hydration paths require a non-negative integer. If a malformed or unvalidated template config contains -1 or 1.5, applying it stores that value and the generator emits an invalid tolerance into every URL-Test group. Keep this runtime guard consistent with validateSubBoostTemplateConfig/persistence by requiring an integer >= 0 before applying it.

Useful? React with 👍 / 👎.

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.

1 participant