Add NativeScript 9.1 offline messenger SQLite prototype - #5936
Closed
christse wants to merge 3 commits into
Closed
Conversation
Local iPhone-chrome demo indexes realm JSON files into boxel_index via node:sqlite, queues chat with card attachments, and reconciles with the same classify/push/pull rules as boxel realm sync. Native messenger target is matrix-sdk-rust, not matrix-js-sdk. Co-authored-by: Chris Tse <christse@users.noreply.github.com>
Lite indexer stamps _title, fullName, initials, handle, and kindLabel into boxel_index.search_doc at index time. Search is json_extract on that column; a contrast filesystem scan is shown only to prove those computed strings are absent from the JSON:API source. Co-authored-by: Chris Tse <christse@users.noreply.github.com>
Co-authored-by: Chris Tse <christse@users.noreply.github.com>
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.
Background and Goal
This adds a local, runnable prototype of an offline Boxel messenger that indexes realm card JSON files into SQLite and later reconciles with the same classify/push/pull rules as
boxel realm sync. It is the data plane a NativeScript 9.1 iOS / Mac Catalyst app would share; it is not a replacement for the Ember host or for prerendered card execution.The native Matrix client on that path is matrix-sdk-rust (UniFFI, SQLite store, same stack as Element X).
matrix-js-sdkstays in the host. The prototype’srooms/messagestables stand in formatrix.sqliteuntil that FFI is wired.Search is SQLite
boxel_index.search_doc, not the JSON files. Computed keys (_title,fullName,initials,handle) are stamped at index time and queried withjson_extract. A query such asMGor@maple.grovehits the index and misses a filesystem scan of the JSON:API source.Where to start
docs/nativescript-offline-messenger.md— feasibility, NativeScript 9.1 fit, rust-vs-JS Matrix choice, two-SQLite-file layout.prototypes/boxel-native/core/— filesystem, lite indexer (boxel_index), computedsearch_doc, sync-logic port, messenger stand-in.prototypes/boxel-native/web-simulator/— iPhone chrome UI. Run withnode web-simulator/server.mjsand open http://127.0.0.1:4173/Key decisions and non-obvious mechanics
pristine_docplus asearch_docthat includes computed fields the JSON file does not store. Search never greps realm files.packages/boxel-cli/src/lib/sync-logic.ts(dependency-free copy in the prototype).boxel-index.sqliteandmatrix.sqliteseparate. Card bytes move through realm file sync; chat attachments are Matrix events pointing at a realm URL.node:sqliteis the local stand-in;ns debug ioson a Mac with Xcode is the NativeScript 9.1 path.