Skip to content
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

Call reducer events on failed updates #130

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from
Draft

Conversation

bfops
Copy link
Collaborator

@bfops bfops commented Sep 10, 2024

Description of Changes

Apply Alessandro's bugfix to call reducer events on failed updates.

I couldn't directly open a PR for Alessandro's branch because it's based on v0.11.0-beta, which is an orphan commit.

This is the original commit:

commit efbb0ccc7633276876801c719e9f8e91f7ac9e51 (origin/alessandro/bugfix/v0.11.0-beta-bugfix)
Author: Alessandro Asoni <[email protected]>
Date:   Fri Sep 6 15:49:50 2024 +0200

    Call reducer event for failed updates

diff --git a/Scripts/SpacetimeDBClient.cs b/Scripts/SpacetimeDBClient.cs
index 89774b5..dd7193c 100644
--- a/Scripts/SpacetimeDBClient.cs
+++ b/Scripts/SpacetimeDBClient.cs
@@ -352,6 +352,15 @@ namespace SpacetimeDB
                                 }
                                 break;
                             case UpdateStatus.Failed(var failed):
+                                // Convert the generic event arguments in to a domain specific event object
+                                try
+                                {
+                                    reducerEvent = ReducerEventFromDbEvent(transactionUpdate);
+                                }
+                                catch (Exception e)
+                                {
+                                    Logger.LogException(e);
+                                }
                                 break;
                             case UpdateStatus.OutOfEnergy(var outOfEnergy):
                                 Logger.LogWarning("Failed to execute reducer: out of energy.");

API

No

Requires SpacetimeDB PRs

None

@bfops bfops changed the title Call reducer events on failed updates. Call reducer events on failed updates Sep 10, 2024
@bfops bfops changed the base branch from master to staging September 10, 2024 19:28
@bfops bfops marked this pull request as ready for review September 11, 2024 17:14
@bfops bfops marked this pull request as draft September 11, 2024 17:21
@jdetter
Copy link
Collaborator

jdetter commented Sep 11, 2024

Based on the discussion in discord it sounds like Ingvar/Jeremie are pushing this forward, please reassign me if you want me to take a look

@jdetter jdetter removed their request for review September 11, 2024 17:23
@bfops bfops requested review from lcodes and removed request for RReverser September 11, 2024 17:24
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