Skip to content

[board] Record views and feedback results without the events consent - #333

Closed
arifBurakDemiray wants to merge 1 commit into
stagingfrom
board/parity-r53
Closed

arifBurakDemiray wants to merge 1 commit into
stagingfrom
board/parity-r53

Conversation

@arifBurakDemiray

Copy link
Copy Markdown
Member

Card C-141: Bring R53 Internal (feature) events recorded regardless of the "events" consent to the Java SDK

Why: views and feedback widget results go through the events module, so without Config.Feature.Events and its consent they are dropped, while Android, iOS and HarmonyOS record them under their own consent (parity R53).
Change:

  • ModuleEvents is always built: a view needs only the views consent, a feedback result only the feedback consent.
  • Custom events still need the events consent (ModuleBase.featureRuns()); custom events stored by an earlier run wait for it and do not count toward the queue threshold.
  • Removing the events consent drops custom and timed events, plus views and feedback results whose own consent is gone too (a full opt-out still purges everything); Countly.isTracking(Events) and events() behave as before.
    Decided:
  • Always build the module, as sessions and user profile are, over moving the queue out of it (larger, 11 test files touch it) or a second send path for views (duplicates batching and journey triggers). Android and iOS keep one always-on queue and check consent per key (ModuleEvents.internalEventConsents, isReservedEvent).
  • events().recordEvent("[CLY]_view") still needs the events consent. Android checks the key's own consent there; rejected, as it would drop those calls from apps that enable only Events.
  • Views and feedback results stored by an earlier run go out at the first flush (consent checked when recorded, as on Android and iOS); before, they waited for the events consent.
  • CHANGELOG entry is a ! Minor breaking change !, as more data is sent for the same consents (Android and iOS shipped it unflagged).
    Checked: 13 new scenario tests, 4 of them against a localhost mock Countly server (views, feedback, a restart with stored custom events, a 500 answer); the 11 behaviour tests each failed first for the expected reason, 2 guards (feedback with only the events consent, content events) pass before and after. Plus an EventQueue.take test, and 3 tests that asserted the old drop updated. :sdk-java:build on Java 8: 758 pass. Two code review passes added the custom event gate in recordEventInternal, the TimedEvents.restore guard, the threshold count, the opt-out purge, the previous event ID reset and a null-safe SDKCore.enabled; simplify replaced Events special cases with featureRuns() and EventQueue.take/count; security review found nothing (feedback answers are no longer logged at info level).
    Not checked: sdk-java-ui tests: compiled only; the module is untouched, and 2 JavaFX toolkit tests timed out in the one run on this machine.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Dependency security scan

Scanned 25 resolved dependencies, failing on HIGH and above.

No known vulnerabilities in 25 resolved dependencies.

Result: passed

Full run log

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Unit Test Results 🚀

758 tests  +14   758 ✅ +14   2m 53s ⏱️ +2s
 65 suites + 1     0 💤 ± 0 
 65 files   + 1     0 ❌ ± 0 

Results for commit 48cabf1. ± Comparison against base commit 7639e9c.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Code coverage

module lines branches
sdk-java 89.9% (7294/8112) 80.4% (3259/4052)
sdk-java-ui 70.5% (968/1374) 63.2% (499/790)

Files changed by this pull request

file lines covered
sdk-java/src/main/java/ly/count/sdk/java/internal/EventQueue.java 95.5% (64/67)
sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleBase.java 92.6% (25/27)
sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleEvents.java 95.5% (236/247)
sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleFeedback.java 82.0% (214/261)
sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java 90.1% (336/373)
sdk-java/src/main/java/ly/count/sdk/java/internal/SDKCore.java 89.6% (397/443)
sdk-java/src/main/java/ly/count/sdk/java/internal/TimedEvents.java 68.4% (54/79)
Least covered classes (10 shown)
class module lines covered uncovered
ly.count.sdk.java.ui.JavaFxContentDisplay sdk-java-ui 10.6% (23/216) 193
ly.count.sdk.java.ui.FxSurfaces sdk-java-ui 74.8% (172/230) 58
ly.count.sdk.java.ui.ExternalBrowser sdk-java-ui 55.0% (66/120) 54
ly.count.sdk.java.internal.SDKCore sdk-java 89.2% (372/417) 45
ly.count.sdk.java.ui.JavaFxWidgetHost sdk-java-ui 81.2% (190/234) 44
ly.count.sdk.java.internal.ModuleRequests sdk-java 75.9% (132/174) 42
ly.count.sdk.java.internal.SessionImpl sdk-java 90.1% (274/304) 30
ly.count.sdk.java.internal.ModuleContent sdk-java 90.4% (282/312) 30
ly.count.sdk.java.internal.SDKStorage sdk-java 84.5% (158/187) 29
ly.count.sdk.java.internal.ModuleFeedback sdk-java 86.1% (179/208) 29

Full run log

@arifBurakDemiray
arifBurakDemiray deleted the board/parity-r53 branch November 4, 2026 12:10
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