Skip to content

feat: add waypoint update subscriptions - #16

Draft
JackCuthbert wants to merge 1 commit into
mainfrom
feat/waypoint-subscriptions
Draft

JackCuthbert wants to merge 1 commit into
mainfrom
feat/waypoint-subscriptions

Conversation

@JackCuthbert

Copy link
Copy Markdown
Owner

Summary

  • add opt-in /xaerosync subscribe <player> and unsubscribe commands for trusted waypoint sources
  • notify online subscribers when a source uploads, restores, or replaces its canonical waypoint set
  • deliver pending updates to offline subscribers when they next join
  • offer styled Replace & reconnect, Dismiss, and Remind later actions without changing live client files
  • preserve the subscriber's current canonical set as a restore point before every accepted replacement
  • persist UUID-based subscription and prompt state under plugins/XaeroSync/subscriptions/

Player experience

Subscribing follows future changes and does not copy or replace the player's current waypoints. The confirmation message explains this and offers a clickable action for the existing one-time copy flow.

Each changed source snapshot is offered once with the source name, upload time, dimension count, file count, and waypoint count. Ignoring or dismissing it leaves the subscriber untouched. Remind later offers it once more on the next join. Replace & reconnect verifies the exact offered update, saves the current backup, and uses the existing reconnect-time download flow.

/xaerosync status lists followed players. Subscription actions require the existing xaerosync.replace permission because accepting an update performs the same trusted-player replacement.

Server compatibility and storage

This is additive to the v1 server layout and wire protocol. Existing player snapshots and clients remain compatible. Subscription records are separate, atomic JSON files keyed by subscriber UUID; player names are display-only and UUIDs remain authoritative.

No subscription event sends a waypoint snapshot during play or writes client files. Canonical uploads continue succeeding even if a subscription record cannot be read.

Verification

  • mise run format
  • mise run test
  • mise run verify

Manual UAT

Use two players, Alice and Bob, with disposable client instances and the same test server.

  1. Have Alice and Bob join once and create distinct waypoints so both have server backups.
  2. As Bob, run /xaerosync subscribe Alice. Confirm Bob's current waypoints remain unchanged, the output explains confirmation is required, and /xaerosync status lists Alice.
  3. As Alice, create or edit a waypoint and wait for it to upload. Confirm Bob receives one styled prompt with source, timestamp, counts, and three clickable actions. Wait or make unrelated changes and confirm the same snapshot is not prompted again.
  4. Click Dismiss as Bob. Rejoin Bob and confirm the dismissed update is not offered and Bob's waypoints remain unchanged.
  5. Make another Alice update. Click Remind later as Bob, confirm it does not repeat during that session, then reconnect Bob and confirm it appears once.
  6. Click Replace & reconnect. Confirm Bob is told to reconnect and Bob's live Xaero waypoints do not change yet.
  7. Reconnect Bob and confirm Alice's offered waypoint set is loaded. Run /xaerosync backups and confirm Bob's prior set is available as a restore point.
  8. Disconnect Bob, make one more Alice update, then join Bob. Confirm the pending prompt is delivered after login.
  9. Run /xaerosync unsubscribe Alice, update Alice again, and confirm Bob receives no prompt.

Closes #5.

Players can subscribe to another trusted player's future waypoint changes and choose whether to replace, dismiss, or revisit each update. Replacements preserve the current backup and take effect safely after reconnecting, while server administrators retain UUID-based persistent subscription records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add optional waypoint subscriptions with update prompts

1 participant