Skip to content

fix: Remove storage purge() methods so that the storage frontends can fill in the functionality - #694

Closed
janbuchar wants to merge 1 commit into
v4from
fix-rq-purge
Closed

janbuchar wants to merge 1 commit into
v4from
fix-rq-purge

Conversation

@janbuchar

Copy link
Copy Markdown
Contributor

@janbuchar janbuchar added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 20, 2026
@janbuchar
janbuchar requested review from B4nan and barjin August 20, 2026 13:11
@github-actions

Copy link
Copy Markdown

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-sdk-js/actions/runs/32372865287#summary-96437235858

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @janbuchar !

A few ideas - the first two are nits, the last one (dropping & migration) I'm actually curious about.

Comment on lines +23 to +24
private readonly client: KeyValueStoreClient,
private readonly onDropped?: () => void,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's do the private / #identifer switch in SDK v4 as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do {
const { items, isTruncated, nextExclusiveStartKey } = await this.client.listKeys({ exclusiveStartKey });

// Sequentially: a store with many records would otherwise fire a whole page of deletes at once.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

// Sequentially: a store with many records would otherwise fire a whole page of deletes at once.

We could have some reasonable-sized batches for this, but perf updates can always come later, this is strictly internal anyway.

Comment on lines +184 to +185
/** Storages this backend dropped; the run's configuration and the Actor's schema still point at them. */
private readonly droppedStorageIds = new Set<string>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What happens if

  1. we drop a storage (it's possible to call .drop() on its own, right?)
  2. the run migrates
  3. we try to open the dropped storage

droppedStorageIds seems ephemeral (it might disappear with the migration), no?

@janbuchar

Copy link
Copy Markdown
Contributor Author

The tests fail because the crawlee part is not yet released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. 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.

4 participants