Repository navigation
fix(settings): start on the active settings when a pending change is blocked, and allow withdrawal - #130
Draft
DMontgomery40 wants to merge 2 commits into
Draft
fix(settings): start on the active settings when a pending change is blocked, and allow withdrawal#130DMontgomery40 wants to merge 2 commits into
DMontgomery40 wants to merge 2 commits into
Conversation
Serve the active revision when unresolved fax work blocks an AMI replacement, and expose the waiting reason. Add revision-checked, audited pending withdrawal through the API, console and CLI, preserving active settings and captured provider authority. Cover startup recovery, later promotion, permissions, atomicity and console states with offline tests.
… roadmap The roadmap entry for blocked pending settings sat above the roadmap key, outside the Implemented list, and the operator paragraph sat in the documentation-and-development section. Move the entry to the top of the Implemented list and the paragraph next to the Quick start notes on restarts and active settings, where an administrator recovering a start looks for it. Wording is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A blocked pending settings change no longer stops Faxbot from starting
Before this change, a settings change saved for the next restart could leave the installation unable to start. One example is turning sending off or changing the Asterisk manager login while a SIP fax was still unresolved. Every start raised
ConfigurationActivationErrorin the drain check, and the API was the only way to settle the fax or undo the change. On the partner installation the container restart-looped until the pending revision was replaced offline.What changes:
config_runtime.py). The drain check now returns a sentence instead of raising. When the pending revision would replace the fax engine connection while a fax is unresolved, Faxbot starts on the active revision and logs the reason. The pending revision is kept and is not promoted. Once the fax is settled, the next start promotes it as before.GET /admin/settingsreturns_meta.pending_block_reason, for example "Pending settings wait until fax is settled. Drain or reconcile unresolved faxes before replacing the fax engine connection." The Settings console shows it in place of the restart notice, because a restart would not help.faxbot admin settings getandreloadprint it.POST /admin/settings/withdrawtakesexpected_revision_id, the desired revision the caller loaded. It clears the pending revision, keeps the active settings and the revision history, and writes asettings.withdrawaudit row in the same transaction. Withdrawal is checked like any other write, against what it undoes:settings:write, plusproviders:writeor owner rights when the pending change needs them. A stale revision is refused with 409, and a second withdrawal reportschanged: false. The console button is Withdraw pending changes, shown whenever changes are pending; readers see a sentence instead. The CLI command isfaxbot admin settings withdraw, anddocs/reference/cli.mdis regenerated.The branch is rebased onto main 630644f. That base includes the lean CI gate and #127. The only conflict was in README: #127 added a SIP-registration paragraph and roadmap entry in the same two places. I kept both, with #127's text first. Six files overlap #127;
main.py,client.ts,types.ts,test_cli.pyanddocs/reference/cli.mdmerged cleanly.make cli-docsproduces no change.One limitation is not fixed here. At startup,
.envcredentials and other startup adoptions are still written on top of the desired revision. While a change is blocked, the desired revision is the pending one. A credential changed in.envduring that time is saved into the waiting revision and takes effect only when that revision is promoted or the change is withdrawn. Before this PR the same start failed outright.Checks on this head
On this head, after rebasing onto 630644f:
make test-localwithtest_console_cli_parity,test_settings_coverage,test_configuration_runtime,test_configuration_ami_drain,test_route_policy_coverageand the settings/withdraw tests intest_cli: 57 passed, 4 skipped.settingsParity,systemScreensandnavigation: 126 passed.npx tsc --noEmitis clean.make cli-docsproduces no diff.secret-scan.sh origin/main: no suspicious added lines.The broader runs below were on the same two commits before the two rebases. The first rebase brought only CI,
conftest.pymarkers,AGENTS.md,CONTRIBUTING.mdand README. The second brought #127's outbound, routing and console changes.make test-local PYTEST_ARGS='… -k "withdraw or lifespan or abandon or legacy_failed or captured_manifest"'. Result: 13 failed, 7 skipped.ConfigurationActivationError: Unresolved AMI faxes must be drained or reconciled….AttributeError: … withdraw_pending_authorized.make test-localwith the touched test files (test_access_configuration_access,test_access_configuration_writes,test_configuration_ami_drain,test_configuration_runtime,test_cli): 203 passed, 83 skipped. This ran before both rebases.make test-localwithtest_console_cli_parity,test_settings_coverage,test_route_policy_coverage,test_route_policy,test_request_identity,test_config_activation,test_config_store,test_configuration_integration,test_configuration_audit_lifecycle,test_engine_login,test_cli_admin,test_config_env_secrets,test_api,test_runtime,test_release_upgrade,test_config_views,test_access_configurationandtest_config_paths: 261 passed, 60 skipped. This also ran before both rebases.make test-localwith the rest of the/admin/settings, lifespan and settings-CLI callers (27 files, includingtest_admin_hybrid,test_capabilities,test_sip_http,test_sip_access,test_sip_network,test_sip_fax_mode,test_inbound_handover,test_answer_cap,test_fax_friendly,test_savings_mechanisms,test_telnyx_faxandtest_plan_budget): 733 passed, 288 skipped. Thentest_efax,test_humblefaxandtest_provider_accounts, the remainingconfig_activationimporters: 199 passed, 19 skipped. Both ran after the first rebase, on main ed024b1.Settings(settingsParity,numbersRecipients,navigation,sinchBasicAuth,efaxSettings,providersRevised,telnyxFaxSettings,humblefaxReceiving,systemScreens): 171 passed. This ran after the first rebase.Not checked
config_storeonly to build fixtures; the run had reached the time budget. They do not touch settings writes, startup or the settings routes. The files:test_access_bootstrap,test_access_context,test_access_outbound,test_access_runtime,test_access_sessions,test_analysis,test_batching,test_capacity,test_certainty,test_combinations_submit,test_database_busy,test_destination_capture_pricing,test_destination_plan_pricing,test_digital_direct,test_digital_fhir,test_direct_delivery,test_hylafax_engine,test_outbound_idempotency,test_outbound_now,test_outbound_store,test_partner_relay,test_peer_fax,test_routing_local,test_routing_multiprovider,test_routing_store,test_rules_delivery,test_sinch_route,test_t38_loopback,test_tollfree_dialing. The lean CI gate runs the ones not marked heavy. Theconfig_valuesimporters were not run either, becauseconfig_values.pyis unchanged.Pre-existing failures
None found. Every test run on this branch passed.
Closes #85
🤖 Generated with Claude Code