Skip to content

Conversation

@takaokouji
Copy link

Summary

This PR corrects the cost estimation for Mesh V2 to accurately reflect AWS AppSync billing.

Changes

  • Updated connection multiplier from 3 to 1 to match the unified subscription model (all messages now arrive through a single subscription).
  • Moved message counter increments to the subscription callback (startSubscriptions) before filtering by nodeId. This ensures self-notifications are counted, as they are billed by AppSync even if ignored by the client.
  • Removed redundant counter increments from handleDataUpdate and handleBatchEvent.
  • Updated existing unit tests to match the new cost tracking architecture.
  • Added a new unit test (mesh_service_v2_cost.js) to verify accurate billing estimation including self-notifications.

Verification

  • Ran npm run lint (Passed).
  • Ran all unit tests with npm run tap:unit (All 70 suites passed).
  • Specifically verified cost calculation in logs: Subscription Connection: 1000000.00 min × 1 = bash.08000000.

Fixes #77
Related to smalruby/smalruby3-gui#500

🤖 Generated with Gemini Code

Co-Authored-By: Gemini noreply@google.com

- Updated connection multiplier from 3 to 1 to match unified subscription model
- Moved message counter increments to subscription callback to include self-notifications
- Updated unit tests to match new cost tracking architecture
- Added mesh_service_v2_cost.js to verify accurate billing estimation

Fixes #77
Related to smalruby/smalruby3-gui#500

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
@takaokouji takaokouji merged commit f775fb1 into develop Jan 3, 2026
1 check passed
@takaokouji takaokouji deleted the fix/issue-77-cost-calculation branch January 3, 2026 08:29
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.

Fix inaccurate AWS AppSync cost calculation after subscription unification

2 participants