Skip to content

fix(storage): publish namespace positions atomically - #2846

Merged
openai0229 merged 2 commits into
OtterMind:mainfrom
HandSonic:fix/namespace-position-atomic
Sep 17, 2026
Merged

openai0229 merged 2 commits into
OtterMind:mainfrom
HandSonic:fix/namespace-position-atomic

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue was found.

Summary

Namespace datasource-position operations mutated live datasourceIds lists before persistence. A write failure left memory moved/deleted while disk and reload state remained old. This change deep-copies the complete namespace map, persists the candidate first, publishes one volatile map reference, and preserves null namespace as move-to-root.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

Risk and compatibility

  • Public API or stored data: Existing namespace JSON and request semantics are unchanged.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: Shared Community namespace storage.
  • Backward compatibility: Null target still moves a datasource to root; successful ordering remains append-to-target.

Reviewer map

  • Start here: NamespaceStorage.copyDataMap/persistPositions and atomic-write tests.
  • Failure condition: a failed write changes live objects, or null target throws instead of moving to root.
  • Rollback or disable path: Revert commit 25ada3b790c0649857cb733aa4caa792f4ccb2ef; no migration is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, deterministic tests, verification, and adversarial review.

Latest-main revalidation (2026-09-04)

  • Rebased onto upstream 144a04e; current head 25ada3b.
  • Full storage module: 61/61 passed.

@HandSonic
HandSonic requested review from a team and openai0229 as code owners August 31, 2026 03:39
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 31, 2026
@HandSonic
HandSonic force-pushed the fix/namespace-position-atomic branch 2 times, most recently from b4a8bef to c264c4e Compare September 3, 2026 08:08
@HandSonic
HandSonic force-pushed the fix/namespace-position-atomic branch from c264c4e to 25ada3b Compare September 3, 2026 21:07
@openai0229
openai0229 merged commit b181087 into OtterMind:main Sep 17, 2026
23 of 25 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants