feat: Support a complete flush and upload without shutting down.#2757
Conversation
|
@codex review |
97521b3 to
7e09d0b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97521b3c7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| flush() | ||
| allStorages.forEach { $0.setIgnoreFilesAgeWhenReading(to: true) } | ||
| allUploads.forEach { $0.flush() } |
There was a problem hiding this comment.
Prevent writes from escaping
flushAndUpload()
flushAndUpload() drains currently queued work with flush(), then performs a single per-feature upload pass while the SDK remains active; because event writers keep running concurrently, any event produced after the initial drain (for example from background instrumentation or queued eventWriteContext work) can be persisted after that feature’s uploader has already been flushed and therefore remain pending when this method returns. This breaks the new method’s “all events were stored and got uploaded” guarantee and can make integration tests flaky unless writes are quiesced or a second drain/upload cycle is added.
Useful? React with 👍 / 👎.
What and why?
The integration test framework needs to be able to flush all data to quickly test features.
refs: RUM-14895
Review checklist
make api-surfacewhen adding new APIs