Skip to content

v0.1.4: Scan and queue without an API key - #6

Merged
akarineren merged 2 commits into
mainfrom
dev
Jul 27, 2026
Merged

v0.1.4: Scan and queue without an API key#6
akarineren merged 2 commits into
mainfrom
dev

Conversation

@akarineren

Copy link
Copy Markdown
Member

Summary

Scanning and queueing are local work and no longer require an API key. The key
gates only the upload half, so a user who has not signed in yet keeps
accumulating history instead of losing it — and it uploads as soon as a key is
saved.

This matters for the Windows front-end consuming pkg/agentlib: it can scan and
record from first launch, before any sign-in flow completes.

Changes

  • cli.App.Ingest no longer requires a key; cli.App.Upload does (3ec862f)
  • agentlib.Client.Sync scans, then skips the upload when no key is configured
  • agentlib.Client.SendHeartbeat now inserts the event before checking the
    key — previously an editor sending heartbeats pre-sign-in dropped every one
  • cli.App.Sync and agentlib.Client.Sync had opposite behavior without a key
    (error vs nil); both now skip the upload and succeed

Testing

  • TestSendHeartbeatWithoutAPIKeyQueuesEvent asserts the event is actually in
    the queue, not merely that no error was returned — verified it fails against
    the old ordering
  • TestSyncWithoutAPIKeyScansOffline, TestIngestWorksWithoutAPIKey,
    TestUploadRequiresAPIKey cover the split
  • go vet ./... and go test -race ./... pass

SendHeartbeat checked the API key before InsertEvents, so an editor that
started sending heartbeats before the user signed in dropped every event
instead of queueing it. Insert first, then skip only the upload half when
no key exists — the same rule Ingest/Upload already follow.

cli.App.Sync returned an error without a key while agentlib.Client.Sync
returned nil; both now skip the upload and succeed.
@akarineren
akarineren merged commit b9603ca into main Jul 27, 2026
1 check passed
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.

1 participant