Skip to content

Strip serverOnlyFields from push conflict responses#391

Merged
pubkey merged 1 commit intomasterfrom
copilot/fix-issue-8291
Apr 7, 2026
Merged

Strip serverOnlyFields from push conflict responses#391
pubkey merged 1 commit intomasterfrom
copilot/fix-issue-8291

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Push conflict responses return raw master documents including serverOnlyFields, causing schema validation failures on clients with additionalProperties: false. Pull and pullStream handlers already strip these fields; push was the only omission.

Changes

  • src/plugins/server/endpoint-replication.ts: Map conflicts through removeServerOnlyFields before returning, consistent with pull/pullStream handlers:
    -adapter.endResponseJson(res, conflicts);
    +adapter.endResponseJson(res, conflicts.map(c => removeServerOnlyFields(c)));
  • test/unit/endpoint-replication.test.ts: Add test that triggers a push conflict via stale assumedMasterState and asserts the response excludes serverOnlyFields, _rev, and _meta.

When a push results in a conflict, the response now strips
serverOnlyFields from conflict documents before returning them,
consistent with pull and pullStream responses.

Fixes pubkey/rxdb#8291

Agent-Logs-Url: https://github.com/pubkey/rxdb-server/sessions/e57bb436-7043-4f8a-9fc2-006bd5c5c5e2

Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
@pubkey
Copy link
Copy Markdown
Owner

pubkey commented Apr 7, 2026

pubkey/rxdb#8291

@pubkey pubkey marked this pull request as ready for review April 7, 2026 11:43
@pubkey pubkey merged commit 7e9550c into master Apr 7, 2026
2 checks passed
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.

2 participants