Skip to content

getStringOrFlow does not emit updates when removeKey is used #235

@MaderaJan

Description

@MaderaJan

Hi,

Description

When using getStringOrFlow(key) to observe preference changes, calling settings.removeKey(key) does not emit a new value to the flow collectors. However, if I use settings.putString(key, ""), the flow does emit the change as expected.

I’d like to clarify whether this behavior is intentional. Should removeKey trigger emissions in the flow, or is the current behavior by design?

Steps to Reproduce

1.	Collect from getStringOrFlow("some_key")
2.	Call settings.removeKey("some_key")
3.	Observe that the flow does not emit

Expected Behavior

Please confirm:
• Should removeKey emit to the flow?
• If not, is the recommendation to use putString(key, "") to ensure emission?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions