fix: FuelEvent optimistic updates not being applied#40
Merged
Conversation
Coverage Report for @evefrontier/dapp-kit
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR fixes missing optimistic updates for ::fuel::FuelEvent coming from the gRPC checkpoint stream by adding a dedicated BCS decoder for fuel events and dispatching the BCS fallback decoder based on the event type, so fuel events are no longer dropped when protobuf JSON decoding fails.
Changes:
- Added
fuelEventBcs.ts(FuelEvent + Action enum) and routed checkpoint-stream BCS fallback decoding to fuel vs. inventory based oneventType. - Deduplicated shared BCS primitives (
BcsObjectId,TenantKey) intoutils/events/consts.tsand updated imports accordingly. - Bumped
@evefrontier/wallet-coreto0.0.4and updated affected lockfile/test expectations.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/libs/dapp-kit/utils/inventory.ts | Simplifies adjustInventoryUsedCapacity signature by removing overload declarations. |
| packages/libs/dapp-kit/utils/events/inventoryEventBcs.ts | Switches to shared BCS consts import for object IDs and tenant keys. |
| packages/libs/dapp-kit/utils/events/fuelEventBcs.ts | Adds BCS decoding + parsedJson shaping for on-chain FuelEvent. |
| packages/libs/dapp-kit/utils/events/consts.ts | Introduces shared BcsObjectId + TenantKey definitions for event decoders. |
| packages/libs/dapp-kit/utils/events/checkpointStream.ts | Renames payload parsing helper and dispatches BCS decoding to fuel vs inventory based on type suffix. |
| packages/libs/dapp-kit/utils/tests/inventoryEventBcs.test.ts | Updates test import path to match utils/events/ location. |
| packages/libs/dapp-kit/utils/tests/constants.test.ts | Updates expected EVE coin type for TenantId.STILLNESS (aligned with wallet-core bump). |
| packages/libs/dapp-kit/providers/SmartObjectProvider.tsx | Adds temporary console debug output when processing stream events (needs cleanup before merge). |
| packages/libs/dapp-kit/package.json | Bumps @evefrontier/wallet-core to 0.0.4. |
| bun.lock | Updates workspace package versions and resolved @evefrontier/wallet-core to 0.0.4. |
| biome.jsonc | Updates Biome schema reference from 2.5.0 to 2.5.1. |
ccp-bofai
reviewed
Jun 25, 2026
ccp-bofai
reviewed
Jun 25, 2026
ccp-bofai
reviewed
Jun 25, 2026
ccp-bofai
left a comment
There was a problem hiding this comment.
Can you explain the changes I have commented on please.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
fuelEventBcs.tswith a BCS struct definition matching the on-chainFuelEventMove struct (including theActionenum), anddecodeFuelEventBcs/fuelEventBcsToParsedJsonfunctions mirroring the inventory BCS decoder patternBcsObjectIdandTenantKeyfrominventoryEventBcs.tsso both decoders share the same definitionsparseInventoryEventPayloadFromStream→parseEventPayloadFromStreamand added aneventTypeparameter; the BCS fallback now dispatches to the fuel decoder for::fuel::FuelEventtypes and the inventory decoder for all othersv0.0.4dapp-kitback to0.0.10Why
Fuel events (
::fuel::FuelEvent) from the gRPC checkpoint stream were silently dropped before reaching theonEventshandler inSmartObjectProvider, so the Network Node Monitor never received optimistic updates for fuel quantity orisBurningstate.The cause:
parseEventPayloadFromStreamattempts to decode event payloads from protobuf JSON first, then falls back to BCS bytes. The BCS fallback was hardcoded toInventoryMoveEvent— passing FuelEvent BCS bytes to that decoder throws, the catch returnsnull, andextractInventoryEventsFromCheckpointfilters the event out.Screenshots / Gifs
Where has this been tested?