Repository navigation
feat(permissions): refresh snapshots from live invalidations - #23
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc066b4bd0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private val inFlight = ConcurrentHashMap.newKeySet<UUID>() | ||
|
|
||
| fun invalidate(playerId: UUID) { | ||
| if (!isOnline(playerId) || !inFlight.add(playerId)) return |
There was a problem hiding this comment.
Preserve invalidations received during an active refresh
When another invalidation for the same player arrives after the first refresh has started, this early return discards it permanently. If the first REST request captured policy state before the second mutation but completes afterward, the coordinator installs that older snapshot and schedules no follow-up fetch; both Velocity and Minestom can therefore retain a stale grant or revocation until the periodic sweep reaches refreshAfter. Record a pending invalidation and rerun the refresh after the in-flight request completes rather than dropping the event.
Useful? React with 👍 / 👎.
Summary
permissions.snapshot.invalidatedCore NATS event in the shared runtime moduleSafety
schemaVersionandplayerIdfields is acceptedVerification
./gradlew test./gradlew spotlessApply./gradlew buildvelocity-plugin.jsonClockconstructors remain available