-
Notifications
You must be signed in to change notification settings - Fork 12
PT-4162: Power-mode startup/shutdown session-sync triggers #2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a25d3be
PT-4162: Add Power-mode startup/shutdown session-sync triggers
rolfheij-sil 3e1a01a
PT-4162: Make shutdown-sync logging truthful and test the timeout path
rolfheij-sil b114ac1
PT-4162: Give the Power-mode startup session sync a boot-appropriate …
rolfheij-sil dd4489d
fix(session-sync): fail closed on unreadable interface mode; retry re…
rolfheij-sil a3d1f1c
feat(session-sync): consume runScheduledSessionSync result and make t…
rolfheij-sil 897cf8b
docs(session-sync): correct stale comments and order startup-tasks fi…
rolfheij-sil 302ed86
test(session-sync): pin the retry cadence/budget and derive fixtures …
rolfheij-sil 47707c6
fix(session-sync): keep the second close-click as the shutdown escape…
rolfheij-sil 5449846
chore(session-sync): normalize papi.d.ts regen to the generator's output
rolfheij-sil 9d71b78
docs(session-sync): add PT-4158 auto-sync design records and restore …
rolfheij-sil 61cebc3
docs(api): tag JSON-RPC error-prefix exports and runScheduledSessionS…
rolfheij-sil 1a0987a
fix(session-sync): apply review round 3 — self-referential comments, …
lyonsil 2065def
docs(session-sync): smooth comments left rough by the ticket-ref removal
lyonsil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { CATEGORY_COMMAND } from '@shared/data/rpc.model'; | ||
| import { serializeRequestType } from '@shared/utils/util'; | ||
|
|
||
| /** | ||
| * Fully-qualified name of the S/R extension command that runs the sync scheduled for a session | ||
| * boundary ("On startup/shutdown"). Shared by the startup and shutdown task modules so the two call | ||
| * sites can't drift apart: a typo in one bare string literal compiles cleanly and both suites still | ||
| * pass (they only assert `stringContaining('runScheduledSessionSync')`), so a single source for the | ||
| * name is the only thing that actually pins them together. | ||
| * | ||
| * This is deliberately NOT wired through the typed `commandService.sendCommand`. That path always | ||
| * applies the shared network retry policy, which both call sites exist specifically to avoid — the | ||
| * shutdown call wants no retry at all, and the startup call has its own longer boot-race budget. | ||
| * Typing the name here (via the extension's vendored `CommandHandlers` declaration) would buy the | ||
| * name check at the cost of the retry semantics `networkService.requestNoRetry` is chosen for, so | ||
| * this shared constant gives the name safety without giving up the raw request path. | ||
| */ | ||
| export const RUN_SCHEDULED_SESSION_SYNC_COMMAND = | ||
| 'paratextBibleSendReceive.runScheduledSessionSync'; | ||
|
|
||
| /** Serialized request type for {@link RUN_SCHEDULED_SESSION_SYNC_COMMAND}. */ | ||
| export const RUN_SCHEDULED_SESSION_SYNC_REQUEST_TYPE = serializeRequestType( | ||
| CATEGORY_COMMAND, | ||
| RUN_SCHEDULED_SESSION_SYNC_COMMAND, | ||
| ); | ||
|
|
||
| /** The two session boundaries at which a scheduled sync can be triggered. */ | ||
| export type SessionSyncBoundary = 'startup' | 'shutdown'; | ||
|
|
||
| /** | ||
| * Result the S/R extension's `runScheduledSessionSync` command resolves with. The command handles | ||
| * its own errors internally and always resolves (it never rejects for an internal failure), so core | ||
| * distinguishes the three real outcomes from this value rather than from resolve-vs-reject: | ||
| * | ||
| * - `synced`: a scheduled sync ran and completed successfully. | ||
| * - `failed`: a scheduled sync ran but did not complete successfully (the extension logged detail). | ||
| * - `skipped`: nothing ran — nothing was scheduled for this boundary, it wasn't due, or another sync | ||
| * was already in progress (the common default state until the user schedules something). | ||
| * | ||
| * A rejection from the call still means the command couldn't be reached/executed at all (not | ||
| * registered yet, or a request timeout); callers treat that separately from these settled | ||
| * outcomes. | ||
| */ | ||
| export type ScheduledSessionSyncResult = 'synced' | 'failed' | 'skipped'; |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.