-
Notifications
You must be signed in to change notification settings - Fork 0
feat(response): persist in-progress events across restart #174
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b0f02f5
feat(response): rebuild ledgers from stored event order
cursoragent f6c5f6b
feat(response): persist in-progress events across restart
cursoragent 50125d2
style(response): apply rustfmt to ledger reconstruction
cursoragent 71c7514
docs(response): record event persist as Active PR #174
cursoragent 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
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,53 @@ | ||
| -- Opaque response-event references remain data, not SQL syntax. The persistence | ||
| -- adapter binds them as query parameters. These checks enforce the canonical | ||
| -- identity boundary (nonblank, nonnumeric-like, no outer whitespace). | ||
| CREATE TABLE IF NOT EXISTS response_event ( | ||
| response_event_ref TEXT CONSTRAINT response_event_response_event_ref_not_null NOT NULL | ||
| CONSTRAINT response_event_response_event_ref_format_check CHECK ( | ||
| response_event_ref = btrim(response_event_ref) | ||
| AND response_event_ref <> '' | ||
| AND NOT ( | ||
| response_event_ref ~ '[[:digit:]]' | ||
| AND response_event_ref ~ '^[[:digit:]+,.eE-]+$' | ||
| ) | ||
| ), | ||
| session_ref TEXT CONSTRAINT response_event_session_ref_not_null NOT NULL | ||
| CONSTRAINT response_event_session_ref_format_check CHECK ( | ||
| session_ref = btrim(session_ref) | ||
| AND session_ref <> '' | ||
| AND NOT ( | ||
| session_ref ~ '[[:digit:]]' | ||
| AND session_ref ~ '^[[:digit:]+,.eE-]+$' | ||
| ) | ||
| ), | ||
| client_event_ref TEXT CONSTRAINT response_event_client_event_ref_not_null NOT NULL | ||
| CONSTRAINT response_event_client_event_ref_format_check CHECK ( | ||
| client_event_ref = btrim(client_event_ref) | ||
| AND client_event_ref <> '' | ||
| AND NOT ( | ||
| client_event_ref ~ '[[:digit:]]' | ||
| AND client_event_ref ~ '^[[:digit:]+,.eE-]+$' | ||
| ) | ||
| ), | ||
| item_version_ref TEXT CONSTRAINT response_event_item_version_ref_not_null NOT NULL | ||
| CONSTRAINT response_event_item_version_ref_format_check CHECK ( | ||
| item_version_ref = btrim(item_version_ref) | ||
| AND item_version_ref <> '' | ||
| AND NOT ( | ||
| item_version_ref ~ '[[:digit:]]' | ||
| AND item_version_ref ~ '^[[:digit:]+,.eE-]+$' | ||
| ) | ||
| ), | ||
| payload_digest TEXT CONSTRAINT response_event_payload_digest_not_null NOT NULL | ||
| CONSTRAINT response_event_payload_digest_format_check CHECK ( | ||
| payload_digest ~ '^sha256:[0-9a-f]{64}$' | ||
| ), | ||
| server_sequence BIGINT CONSTRAINT response_event_server_sequence_not_null NOT NULL | ||
| CONSTRAINT response_event_server_sequence_positive_check CHECK (server_sequence > 0), | ||
| observed_at TIMESTAMPTZ CONSTRAINT response_event_observed_at_not_null NOT NULL, | ||
| received_at TIMESTAMPTZ CONSTRAINT response_event_received_at_not_null NOT NULL, | ||
| CONSTRAINT response_event_pkey PRIMARY KEY (response_event_ref), | ||
| CONSTRAINT response_event_session_client_unique UNIQUE (session_ref, client_event_ref), | ||
| CONSTRAINT response_event_session_sequence_unique UNIQUE (session_ref, server_sequence), | ||
| CONSTRAINT response_event_observed_not_after_received_check CHECK (observed_at <= received_at) | ||
| ); |
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.