Visitar URL original
fix: keep alias storages across migrations and reboots by vdusek · Pull Request #1255 · apify/apify-sdk-python · GitHub
Skip to content

fix: keep alias storages across migrations and reboots - #1255

Merged
vdusek merged 1 commit into
masterfrom
fix/alias-key-stable-across-migration
Nov 13, 2026
Merged

vdusek merged 1 commit into
masterfrom
fix/alias-key-stable-across-migration

Conversation

@vdusek

@vdusek vdusek commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

The platform now issues a new run token on migration and reboot. The alias-to-storage-ID map in the default key-value store was keyed by a hash of the API URL and the token, so after a restart the SDK did not find the entry and opened a new empty storage.

The key now hashes the user ID (APIFY_USER_ID) when the configuration uses the run's own token (APIFY_TOKEN). The user ID stays the same across restarts. A token passed explicitly (for example another user's) is still hashed directly, so the same alias opened by different users keeps mapping to different storages.

Closes: #1254

✍️ Drafted by Claude Code

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

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.92%. Comparing base (0390bac) to head (f746826).

Files with missing lines Patch % Lines
...c/apify/storage_clients/_apify/_alias_resolving.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1255      +/-   ##
==========================================
- Coverage   93.96%   93.92%   -0.04%     
==========================================
  Files          54       54              
  Lines        3828     3837       +9     
==========================================
+ Hits         3597     3604       +7     
- Misses        231      233       +2     
Flag Coverage Δ
e2e 31.24% <40.00%> (?)
integration 51.10% <90.00%> (+0.06%) ⬆️
unit 91.13% <90.00%> (-0.01%) ⬇️

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 November 13, 2026 10:32
@vdusek
vdusek requested review from barjin and janbuchar November 13, 2026 10:32

@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.

Not sure about the Python side of this, but the logic seems in-line with our discussion.

Thanks @vdusek!

@vdusek
vdusek merged commit 5977ff0 into master Nov 13, 2026
41 checks passed
@vdusek
vdusek deleted the fix/alias-key-stable-across-migration branch November 13, 2026 14: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.

Alias storages open a new empty storage after a migration or reboot

3 participants