Repository navigation
polytag/backends: the default backends, and app.open(el) (refs #2, #4) - #43
Merged
Merged
Conversation
…nt, save only on a data change, ETag and changed-elsewhere conflicts, scrubbed errors, no credentials in urls, body inside the timeout, byte sizes, guarded storage, maxRecords, stronger seed check)
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.
Part of #2 and #4. A backend is a document store (load / save of one JSON document), so the catalog stays tag-agnostic. defaultBackends() has inMemory, localStorage (a Storage) and http (GET and PUT of one URL): http refuses credentials or secret-looking keys in the url (they go in headers, marked secret), plain http with headers unless local, scrubs the url, query and header values from every error, keeps the timeout over the body, counts bytes, keeps the ETag and sends If-Match (a 412 is a conflict); localStorage notices a change made elsewhere and refuses to overwrite it. listBackends(catalog, env, { runtime }) and createBackend(catalog, name, options, env) validate options and name every problem; the environment is passed in. app.open(el) loads the collection from the configured backend (the metadata one for bifurcated), mounts it, and saves after each change to the DATA (not a selection), coalesced; a document that cannot be used (not a collection, wrong space, too many records, unreadable) is reported through onError and the view opens read-only so nothing of theirs is overwritten (onInvalidStored: 'replace' to overwrite); a failed or conflicting save is reported, not thrown; destroy() saves the last change. Not built: content backends, fs, S3, Supabase. Independent adversarial review: 14 findings fixed test-first.