Skip to content

Add Lint checks for FirestoreRecyclerAdapter lifecycle methods #1339

Closed
@pavlospt

Description

@pavlospt

Describe the problem:

Currently there are no Lint checks on whether someone has called .startListening() / .stopListening() methods when using a FirestoreRecyclerAdapter, or .setLifecyclerOwner() when using FirestoreRecyclerOptions.Builder. That way the RecyclerView using that adapter will never get any UI updates on items from real-time changes.

Steps to reproduce:

Create a FirestoreRecyclerAdapter and do not call .startListening() / .stopListening() methods.

Alternatively, use FirestoreRecyclerOptions.Builder and do not call .setLifecycleOwner().

Observed Results:

RecyclerView using the adapter will not get any UI updates from real-time changes without any obvious reason, for those who haven't called .startListening() or .setLifecycleOwner().

Expected Results:

Expected a Lint check in place, to inform on whether there is a missing call on .startListening() or .setLifecycleOwner() for FirestoreRecyclerOptions.Builder.

Relevant Code:

I have prepared a relevant PR: #1340

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions