Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
98561c1
perf(desktop): move queue file work and request compression off the U…
turnipdabeets Oct 29, 2026
999597e
fix(desktop): wait only for writes preceding a queue peek
turnipdabeets Oct 30, 2026
323aa07
fix(desktop): exclude AI events being measured from queue eviction
turnipdabeets Oct 30, 2026
f96a209
fix(desktop): keep selecting queue events past unreadable files
turnipdabeets Oct 30, 2026
10e672b
fix(desktop): keep person properties set while an AI event is measured
turnipdabeets Oct 30, 2026
de8ad8e
Merge feat/v6-desktop-capture-v1 into perf/v6-desktop-queue-worker
turnipdabeets Oct 30, 2026
f95745e
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Oct 30, 2026
4d7cfc2
chore(ci): TEMP diagnose the hanging test step
turnipdabeets Oct 30, 2026
e2c9dcd
Merge feat/v6-desktop-capture-v1 into perf/v6-desktop-queue-worker
turnipdabeets Oct 30, 2026
ab63c9f
chore(ci): remove the temporary test step diagnostics
turnipdabeets Oct 30, 2026
a37d170
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Oct 30, 2026
efb0429
fix(desktop): recheck flushAt once a queued event is written
turnipdabeets Oct 30, 2026
4aa84b4
fix(desktop): skip the snapshot write for AI events without person pr…
turnipdabeets Oct 30, 2026
3ac957f
fix(desktop): keep the directory locked until queue file work is done
turnipdabeets Oct 30, 2026
2f337bd
fix(desktop): don't throw from settled while only one queue has file …
turnipdabeets Oct 30, 2026
7d590a7
fix(desktop): bound how long close waits for queue file work
turnipdabeets Oct 30, 2026
548bdfc
fix(desktop): bound the queue writes given to the worker
turnipdabeets Oct 30, 2026
4a116a2
test(desktop): finish queue file work before temp directories are del…
turnipdabeets Oct 30, 2026
42de2a6
fix(desktop): complete capture once the event is written, and survive…
turnipdabeets Oct 30, 2026
6986c84
fix(desktop): complete identify, alias, group and setPersonProperties…
turnipdabeets Oct 30, 2026
a161a9d
docs(desktop): state what awaiting a call keeps, and trim comments
turnipdabeets Oct 30, 2026
df58169
fix(desktop): guard deferred AI person properties with a reset genera…
turnipdabeets Oct 30, 2026
871d15b
fix(desktop): log when queue work falls back to the UI isolate
turnipdabeets Oct 30, 2026
00511ad
refactor(desktop): keep the gzip choice with the encoded body
turnipdabeets Oct 30, 2026
3c1a176
fix(desktop): release the shared worker's logger when its client closes
turnipdabeets Oct 30, 2026
1a72ecd
test(desktop): avoid a protected member in the logger release test
turnipdabeets Oct 30, 2026
a2339be
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Oct 31, 2026
3419fd3
docs: fold #688 release notes into the 6.0 docs
turnipdabeets Oct 31, 2026
7eabd86
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Nov 2, 2026
c1979f4
fix(desktop): keep events after an unmeasured AI event person-processed
turnipdabeets Nov 3, 2026
8eb6fe0
Merge remote-tracking branch 'origin/feat/v6-desktop-capture-v1' into…
turnipdabeets Nov 3, 2026
b5289a3
fix(desktop): limit AI events waiting to be written by estimated byte…
turnipdabeets Nov 3, 2026
d2588d0
test(desktop): cover calls made while the queue worker holds its repl…
turnipdabeets Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changeset/v6-major-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- **Breaking:** send events to capture v1 (`/i/v1/analytics/events`) instead of `/batch/` on iOS, macOS, Android, Windows and Linux β€” update your reverse proxy first, see the [iOS](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md#hosts-without-capture-v1) and [Android](https://github.com/PostHog/posthog-android/blob/main/docs/migration-3.x-to-4.0.md#hosts-without-capture-v1) migration guides
- **Breaking:** retry a 404 on Windows and Linux so events stay queued, printing one warning, also without `debug`, until a reverse proxy or self-hosted instance serves the new path
- **Breaking:** drop the batch on a redirect on Windows and Linux, following only same-origin 307 and 308 redirects, and cap a `Retry-After` wait at 30 seconds
- **Breaking:** write events to disk only when the returned future completes on Windows and Linux, so an unawaited call can be lost on a crash or `exit()` β€” await the call or `Posthog().close()` before `exit()`
- **Breaking:** apply SDK properties, then registered properties, then event properties on Windows and Linux, so your value wins for that event, and run `beforeSend` after that merge
- **Breaking:** always set `$lib` and `$lib_version` from the `PostHog-Sdk-Info` header on Windows and Linux, ignoring changes made in `beforeSend`
- **Breaking:** send person processing as the `process_person_profile: false` option on Windows and Linux, only while it's off, instead of a `$process_person_profile` property on every event
Expand All @@ -36,6 +37,8 @@
- Drop a batch whose 2xx response has no readable per-event results on Windows and Linux instead of counting it as delivered, without resending it
- Log one line per batch that lost events on Windows and Linux, with the endpoint, count and reasons, also for a terminal status, and count a `limited` result as delivered
- Back off failed sends on Windows and Linux from 1 second up to 30 seconds with Β±25% jitter, instead of resending within the flush, treating `Retry-After` as a floor
- Run queued event encoding, file work and request compression on a background isolate on Windows and Linux so they no longer drop frames
- Limit AI events waiting to be written on Windows and Linux to about 50 MiB in memory, dropping the oldest first and completing `captureAi` with `null` for them
- Take an event's timestamp before the `beforeSend` callbacks run on Windows and Linux
- Declare Android `minSdkVersion` 23 to match `posthog-android`
- Add a `defaultValue` option to `isFeatureEnabled()`, returned when the flag has no value
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ file untouched. A new client can try reading the file again. Corrupt file
contents reset the state to defaults; the next state write replaces the file.

`Posthog().close()` makes one attempt to send the queued events and waits for it
for up to two seconds. Events it could not send stay on disk and go out with the
next client, or are lost when state is kept in memory. Closing the app window
does not call `close()`, but the SDK also sends the queue whenever the app
becomes inactive.
for up to two seconds, and for the queue's files for up to two more. Events it
could not send stay on disk and go out with the next client, or are lost when
state is kept in memory. Events are written in the background, so await
`close()` before calling `exit()`; awaiting a capture or `identify` call also
keeps that call's event. Closing the app window does not call `close()`, but the
SDK also sends the queue whenever the app becomes inactive.

## Questions?

Expand Down
1 change: 1 addition & 0 deletions posthog_flutter/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ A personal API key (`phx_...`) in `projectToken` now skips `setup()` with one lo
- **Person processing:** it's sent as the `process_person_profile: false` option only while it's off, instead of a `$process_person_profile` property on every event.
- **Redirects:** only same-origin 307 and 308 redirects are followed. Any other redirect drops the batch.
- **Retries:** a failed batch waits 1 second, doubling up to 30 seconds with Β±25% jitter, instead of retrying within the same flush. `Retry-After` is a floor under that wait, capped at 30 seconds.
- **Writes to disk:** an event is no longer on disk when `capture`, `screen`, `captureException`, `captureFeatureView`, `captureFeatureInteraction`, `identify`, `alias`, `group` or `setPersonProperties` returns, only when the returned future completes. One you didn't await can be lost if the app crashes or calls `exit()` right after. Await the call, or `Posthog().close()`, before `exit()`. Only `close()` also covers events the SDK captures itself, such as `$feature_flag_called`. An `identify` not awaited before `exit()` can lose its `$identify` event for good, because the new ID is already saved. `close()` can now take up to 4 seconds, and a later `setup()` waits for the queue's file work.
- **Timestamps:** an event's timestamp is taken before `beforeSend` runs.
- **AI queue:** `captureAi` events have their own on-disk queue of up to `captureAiMaxQueueSize` events (100 by default) and 50 MiB. An event over `captureAiMaxEventBytes` (8 MiB plus 64 KiB by default) is dropped.

Expand Down
Loading
Loading