-
Notifications
You must be signed in to change notification settings - Fork 9
schema fixes / status messages on failures #954
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
Conversation
|
@jsantell would love your review ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Mostly curious about how the write schema (recipes/bgAdmin.tsx) applies/interacts with the read schema (@commontools/utils/updaters#CharmEntrySchema)
| bg.update({ | ||
| disabledAt: Date.now(), | ||
| lastRun: Date.now(), | ||
| status: error ? error : "Disabled", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider: error ?? "Disabled"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deno typescript doesn't like it:
Property 'error' does not exist on type '{ success: boolean; data?: any; charmId: string; } | { success: boolean; error: string; charmId: string; } | { success: boolean; error: string; }'.
Property 'error' does not exist on type '{ success: boolean; data?: any; charmId: string; }'.
deno-ts(2339)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error is a string | undefined, not sure what that type is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| export async function newGetFunc(): Promise<Cell<Cell<BGCharmEntry>[]>> { | ||
| export async function getBGUpdaterCharmsCell(): Promise< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice renames here 👍
| status: { type: "string" }, | ||
| disabledAt: { type: "number", default: 0 }, | ||
| lastRun: { type: "number", default: 0 }, | ||
| status: { type: "string", default: "" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worthwhile leaving a comment that this schema should (must?) match CharmEntrySchema in @commontools/utils/updaters
Probably a broader question, how does the worker code (via @commontools/utils/updaters) enforce/reject/ignore/handle data on read with a different written schema (e.g. BGCharmEntrySchema here)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call - added the note
w.r.t. the broader question - as long as the schemas are additive the new defaults are loaded.
but I think we have to be careful - as I don't think anything stops us from breaking things with schema changes that aren't backwards compatible

Uh oh!
There was an error while loading. Please reload this page.