Skip to content

Follow up: deduplicate VIEW_STORAGE_SCRAP analytics in StorageScrapFragment #397

Description

@coderabbitai

Summary

VIEW_STORAGE_SCRAP is emitted from two places in StorageScrapFragment, which can overcount screen views in analytics.

Why this matters

The event is currently logged:

  1. when the screen is created (onViewCreated()), and
  2. again after a successful scrap-course load.

Because of this, a single visit can be counted more than once, and pull-to-refresh can also inflate screen-view metrics.

Affected area

  • app/src/main/java/com/runnect/runnect/presentation/storage/StorageScrapFragment.kt

Proposed change

Keep VIEW_STORAGE_SCRAP logging in a single place only.

  • Prefer treating the screen entry point as the source of truth for the screen-view event.
  • Remove the duplicate analytics emission from the load-success path.
  • Preserve the existing course state update behavior.

Acceptance criteria

  • VIEW_STORAGE_SCRAP is emitted exactly once per screen entry.
  • Refreshing the screen does not emit additional screen-view events.
  • Loading success still updates the UI state as before.

Backlinks

Requested by: @unam98

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions