Skip to content

fix!: store copies of data in MemoryStorageBackend - #2376

Merged
vdusek merged 1 commit into
v2from
fix/memory-backend-copies
Nov 2, 2026
Merged

vdusek merged 1 commit into
v2from
fix/memory-backend-copies

Conversation

@vdusek

@vdusek vdusek commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

MemoryStorageBackend stores a JSON snapshot of each dataset item and of each key-value store value with a JSON content type, so mutating an object after push_data or set_value no longer changes stored data. Reads return copies too. The snapshot serializes the same way as FileSystemStorageBackend (default=str), so both backends accept and reject the same values. push_data snapshots the whole batch first, so an unserializable item stores nothing.

Values with a non-JSON content type are stored as they are, matching the content-type check of the other backends.

Closes: #2313

✍️ Drafted by Claude Code

@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 31, 2026
@vdusek vdusek self-assigned this Oct 31, 2026
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v2@a65cd99). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #2376   +/-   ##
=====================================
  Coverage      ?   94.32%           
=====================================
  Files         ?      188           
  Lines         ?    13849           
  Branches      ?        0           
=====================================
  Hits          ?    13063           
  Misses        ?      786           
  Partials      ?        0           
Flag Coverage Δ
unit 94.32% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek marked this pull request as ready for review October 31, 2026 11:48
@vdusek
vdusek requested review from Mantisus and Pijukatel October 31, 2026 11:48

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@apify-approval-mirror apify-approval-mirror 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.

Mirroring approval from @Mantisus.

@vdusek vdusek linked an issue Nov 2, 2026 that may be closed by this pull request
@vdusek
vdusek merged commit 52ca893 into v2 Nov 2, 2026
42 checks passed
@vdusek
vdusek deleted the fix/memory-backend-copies branch November 2, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store copies of values in the memory storage client

2 participants