Skip to content

feat(charging): Support the idempotency_key param in Actor.charge() - #1123

Merged
vdusek merged 11 commits into
apify:masterfrom
Mantisus:charge-idempotency-key
Sep 25, 2026
Merged

vdusek merged 11 commits into
apify:masterfrom
Mantisus:charge-idempotency-key

Conversation

@Mantisus

@Mantisus Mantisus commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Adds support for the idempotency_key parameter in Actor.charge().

Closes: #1122

@Mantisus Mantisus changed the title feat(charging): Allow passing an idempotency key to charge() feat(charging): Support the idempotency_key param in Actor.charge() Sep 8, 2026
@Mantisus Mantisus self-assigned this Sep 8, 2026
@Mantisus
Mantisus requested a review from vdusek September 8, 2026 21:28
@vdusek
vdusek requested a review from szaganek as a code owner September 11, 2026 11:04
Comment thread src/apify/_charging.py Outdated
@Mantisus

Copy link
Copy Markdown
Collaborator Author

@barjin, Please take a look at the implementation.

In the TS SDK, the idempotency_key doesn't affect the ChargingManager. This will cause desynchronization in cases where the API rejects a request with a duplicate idempotency_key.

@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 @Mantisus !

Good catch, we need this in JS SDK as well, otherwise the deduplicated charges will eventually desync the running total count. I opened an issue here.

Otherwise, I left a few ideas regarding the implementation ⬇️ Thanks again!

Comment thread src/apify/_charging.py Outdated
Comment thread src/apify/_charging.py Outdated
@Mantisus

Copy link
Copy Markdown
Collaborator Author

@vdusek, could you recheck this, please?

@vdusek vdusek left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (I just polished some docs content 🙂)

@vdusek
vdusek requested a review from barjin September 24, 2026 17:05
@vdusek

vdusek commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@barjin Do you want to recheck this? 🙂

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

lgtm, thank you both 👋

@vdusek
vdusek merged commit e7f1b75 into apify:master Sep 25, 2026
27 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.

Support the idempotency_key param in Actor.charge()

4 participants