refactor(skychat): share the group controller (move to pkg/skychat/group) + expose Leave/Delete/Invite in wasm - #3595
Open
0pcom wants to merge 3 commits into
Open
Conversation
… core, step 1) The group Manager is already a shared controller — it compiles under js/wasm (CXO tree in-memory), and is imported by pkg/visor, cmd/wasm-visor/group_js.go AND the CLI. It just lived in cmd/apps/skychat/group (the native app's internal tree), which is the wrong home for a library three subsystems depend on. Move it to pkg/skychat/group, alongside the already-shared wire cores (message/xfer/voice). Pure move + import-path update across 9 consumers; no behavior change (group + visor group tests pass, native + js/wasm both build). This is step 1 of extracting the skychat controller to a shared core: it makes the group core's shared status structurally real and gives the wasm side a clean import to consume the FULL Manager surface (Leave/Delete/AddMember/invite) in follow-ups, closing the group feature gaps in the wasm-vs-native comparison.
…rface) The shared group Manager (now pkg/skychat/group) already implements Leave, Delete and BuildInvite; the wasm binding just didn't surface them. Wire them as skychatGroupLeave/Delete/Invite — closing the leave/delete-group + invite-link gaps in the native-vs-wasm skychat comparison, with zero new controller logic (the Manager owns the CXO teardown, roster update and invite signing). Stacked on skycoin#3595 (the group-core move).
… message nano-ts Closes the delete-group-message gap in the native-vs-wasm table. The shared Manager already publishes signed tombstones (Unsend); the wasm binding lacked it because the JS side only had the message ts in milliseconds — from which the exact UnixNano the tombstone must match can't be reconstructed. Surface a ts_nano STRING field (JS numbers lose precision past 2^53) on each group message and bind skychatGroupUnsend(id, tsNano). Still no new controller logic.
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.
Step 1 of sharing the skychat controller.
Manageralready IS a shared controller (compiles under js/wasm with CXO in-memory; imported bypkg/visor,cmd/wasm-visor, and the CLI) — it just lived incmd/apps/skychat/group. Moved topkg/skychat/groupnext to the already-sharedmessage/xfer/voicecores (pure move, 9 importers updated, group + visor tests pass).skychatGroupLeave/Delete/Invite— closing the leave/delete-group + invite-link gaps in the native-vs-wasm table, no new controller logic.Native + js/wasm both build. Follow-ups: delete-group-message (needs nano-ts surfaced), group history backfill, then the DM controller.