Skip to content

UserData is not saved after processing deferred unsubscriptions during FetchExternalUpdatesAsync #20

Description

@lethal-guitar

If deferred unsubscriptions are removed during FetchExternalUpdatesAsync, user data will not be saved after calling RemoveDeferredUnsubscription. This causes the SDK to process the same deferred unsubscription again every time it is initialized, unless user data is saved due to another reason.

I ran into this while I was testing network error handling. I performed an unsubscribe operation in my game's UI after disabling the internet connection. Afterwards, every time I would open my game's mod browser, the SDK would process the same deferred unsubscription every time.
I noticed this while investigating #19.

There should either be a call to SaveUserDataToStorageAsync after the following loop (probably conditional on any deferred unsubscriptions having been removed):

while (Modio::Detail::SDKSessionData::HasDeferredUnsubscriptions())

Or alternatively, UnsubscribeFromModAsync should call RemoveDeferredUnsubscription before it saves the user data:

Modio::Detail::SDKSessionData::InvalidateSubscriptionCache();

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