Skip to content

Handles Failed callbacks in process and stores failed statuses #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 11, 2025

Conversation

joshuahannan
Copy link
Member

  • Marks processed callbacks that were not succeed as failed
  • Stores failed statuses for callbacks in the historic callback field

Base automatically changed from josh/refactor-config to feature/callback-scheduling August 7, 2025 21:05
@@ -244,7 +248,7 @@ access(all) contract FlowCallbackScheduler {
access(all) var refundMultiplier: UFix64

/// historic status limit is the maximum age of a historic canceled callback status we keep before getting pruned
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add in comment what is the unit (timestamp second)?

@@ -401,7 +426,7 @@ access(all) contract FlowCallbackScheduler {
Priority.Low: 2.0
},
refundMultiplier: 0.5,
historicStatusLimit: 30.0 * 24.0 * 60.0 * 60.0 // 30 days
historicStatusAgeLimit: 30.0 * 24.0 * 60.0 * 60.0 // 5 days
Copy link
Contributor

Choose a reason for hiding this comment

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

incorrect comment, let's keep it at 30 for now

if let historic = self.historicCallbacks[id] {
return historic.status
} else if id > self.earliestHistoricID {
return Status.Succeeded
}

return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: I wonder if explicit Unknown status would be better.

Copy link
Member Author

Choose a reason for hiding this comment

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

good suggestion. I'll add Unknown

Copy link
Contributor

@devbugging devbugging left a comment

Choose a reason for hiding this comment

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

Minor feedback

@joshuahannan joshuahannan merged commit 9ae4443 into feature/callback-scheduling Aug 11, 2025
2 checks passed
@joshuahannan joshuahannan deleted the josh/failed-callbacks branch August 11, 2025 18:01
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