Update the Event Flushing Mechanism to save in disk#10
Open
CoderGamester wants to merge 8 commits intoaptabase:mainfrom
Open
Update the Event Flushing Mechanism to save in disk#10CoderGamester wants to merge 8 commits intoaptabase:mainfrom
CoderGamester wants to merge 8 commits intoaptabase:mainfrom
Conversation
…work issues or game being closed - Add the option to save events to disk if they failed to be sent when the game loses focus on the device screen.
…behaviour of Flush methods
…running or without saved cache events
…flowing the PlayerPrefs limit capacity
Contributor
Author
|
bump to merge |
cristipufu
reviewed
May 2, 2025
| { | ||
| Flush(); | ||
| _dispatcher.FlushOrSaveToDisk(); | ||
| StopPolling(); |
Member
There was a problem hiding this comment.
I think that we need to make this return a Task as well:
public static Task Flush()
{
return _dispatcher.Flush();
}Also I think we should avoid async void methods, eg:
private static async void StartPolling(int flushTimer)
Contributor
Author
There was a problem hiding this comment.
Flush already return a Task
And I do agree that we need to avoid async void.
The goal of this PR is to keep changes to a minimal
|
|
||
| public async void Flush() | ||
| public async Task Flush() | ||
| { |
Member
There was a problem hiding this comment.
I'm concerned we don't have any kind of thread safety mechanism on the Flush method
| public class WebGLDispatcher: IDispatcher | ||
| { | ||
| private const string EVENT_ENDPOINT = "/api/v0/event"; | ||
| private const string APTABASE_KEY = "aptabase_key"; |
Member
There was a problem hiding this comment.
Can we have a better name for this key, eg aptabase_events_cache?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the Event Flushing Mechanism to avoid losing events due to network issues or game being closed
Reasoning