Skip to content

Make user cache flushing race-safe - #297

Merged
BenCodez merged 6 commits into
masterfrom
refactor/user-cache-storage
Aug 25, 2026
Merged

BenCodez merged 6 commits into
masterfrom
refactor/user-cache-storage

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Tighten UserDataCache write scheduling and cache ownership without changing its public API.

  • close the race where a change queued while a scheduled flush is finishing could remain unscheduled
  • automatically schedule another flush when work arrived during the previous flush
  • keep scheduled-state transitions synchronized and recover cleanly if the executor rejects scheduling
  • drain queued changes into a stable batch before writing user storage
  • make cache inspection/update helpers null-safe around dump/cleanup
  • defensively copy replacement cache maps instead of retaining caller-owned mutable maps
  • route cache comparison failures through AdvancedCore debug logging instead of raw stack traces

Tests

  • verifies a change queued during an active scheduled flush causes a follow-up flush to be scheduled
  • verifies updateCache(...) does not retain the caller's mutable map

This PR is focused on user cache/storage write correctness; it does not change storage configuration or public user-data keys.

@BenCodez
BenCodez marked this pull request as ready for review August 24, 2026 23:12
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ddabdb67a

ℹ️ 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".

@BenCodez
BenCodez marked this pull request as draft August 25, 2026 00:04
@BenCodez
BenCodez marked this pull request as ready for review August 25, 2026 00:21
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe9d4ddad6

ℹ️ 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".

@BenCodez
BenCodez marked this pull request as draft August 25, 2026 00:27
@BenCodez
BenCodez marked this pull request as ready for review August 25, 2026 00:51
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@BenCodez
BenCodez merged commit a31bbf0 into master Aug 25, 2026
4 checks passed
@BenCodez
BenCodez deleted the refactor/user-cache-storage branch August 25, 2026 23:42
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.

1 participant