Skip to content

feat: add flush and safeFlush for flushing queues#16

Merged
salza80 merged 7 commits into
mainfrom
flush
Jun 22, 2026
Merged

feat: add flush and safeFlush for flushing queues#16
salza80 merged 7 commits into
mainfrom
flush

Conversation

@salza80

@salza80 salza80 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Expose flush and safeFlush from useTelemetryDeck()

  • add getQueueCount - to return number of events in the queue

  • Add tests for raw flush, safeFlush, and plugin-level onError handling

  • Update the local demo page with clearer controls for signal, queue, flush, safe methods, client user changes, and visible action/result/error state

  • Add to demo page onError to test safe command onError callback

Other updates

  • update README
  • Add Prettier and checks

@salza80 salza80 requested a review from Copilot June 22, 2026 13:17
@salza80 salza80 self-assigned this Jun 22, 2026
@salza80 salza80 added the enhancement New feature or request label Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.mjs 1.3 KB (+4.41% 🔺)
dist/index.cjs 1.41 KB (+3.97% 🔺)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds queue flushing support to the TelemetryDeck Vue hook API and updates the demo/tests/tooling to reflect the new flush/safeFlush methods.

Changes:

  • Extend useTelemetryDeck() with flush() and safeFlush() (+ error meta updates).
  • Update demo app + unit tests to exercise flush/safeFlush and improved UI/test structure.
  • Introduce Prettier config/scripts and enforce formatting in CI.

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/hooks/index.ts Adds flush/safeFlush and updates method typing for error meta.
src/tests/hooks.test.ts Extends safe/raw method tests to include flush behavior.
src/tests/plugin.test.ts Verifies plugin onError integration also covers safe flush errors.
src/App.vue Expands demo UI to trigger signal/queue/flush + safe variants and show status.
src/tests/App.test.ts Refactors demo tests and adds coverage for flush + error event display.
src/main.ts Adds demo onError handler that dispatches a telemetrydeck:error event.
README.md Documents flushing queued events and adds formatting commands.
prettier.config.js, .prettierignore Adds shared Prettier config and ignore list.
.github/workflows/*.yml Adds format:check step to CI workflows.
Config/style miscellany Formatting updates + demo styling adjustments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/App.vue
Comment thread src/App.vue
Comment thread src/tests/App.test.ts
Comment thread src/hooks/index.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 24 changed files in this pull request and generated 1 comment.

Comment thread src/tests/App.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 24 changed files in this pull request and generated no new comments.

@salza80 salza80 requested a review from Copilot June 22, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 25 changed files in this pull request and generated no new comments.

@salza80 salza80 merged commit 31987ef into main Jun 22, 2026
1 check passed
@salza80 salza80 deleted the flush branch June 22, 2026 14:52
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants