Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the class FIRMessagingRmq2PersistentStore #4045

Merged
merged 5 commits into from Oct 10, 2019
Merged

Conversation

@chliangGoogle
Copy link
Contributor

@chliangGoogle chliangGoogle commented Oct 10, 2019

The file FIRMessagingRmqManager is essentially calling the same functions of FIRMessagingRmq2PersistentStore, that becomes an unnecessary class layer.
Merging FIRMessagingRmq2PersistentStore into FIRMessagingRmqManager and remove the file FIRMessagingRmq2PersistentStore.

This is a clean up before fixing the issue: b/142357385
We need to move database operations off main thread and by reducing the unnecessary class layer helps us adding async call in the next PR.

minor: remove removeRmqMessagesWithRmqId: method as it's only used in test.

…alling the same functions in FIRMessagingRmq2PersistentStore
@chliangGoogle chliangGoogle changed the title remove the class FIRMessagingRmqManager remove the class FIRMessagingRmq2PersistentStore Oct 10, 2019
@chliangGoogle chliangGoogle changed the title remove the class FIRMessagingRmq2PersistentStore Remove the class FIRMessagingRmq2PersistentStore Oct 10, 2019
Firebase/Messaging/FIRMessagingDefines.h Outdated Show resolved Hide resolved
Firebase/Messaging/FIRMessagingDefines.h Outdated Show resolved Hide resolved
#if defined(DEBUG)
#define FIRMesssaging_MUST_NOT_BE_MAIN_THREAD() \
do { \
NSAssert(![NSThread isMainThread], @"Must not be executing on the main thread."); \
Copy link
Contributor

@morganchen12 morganchen12 Oct 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it's debug-only, this assert may trigger false-positives if the main GCD queue is suspended. See http://blog.benjamin-encz.de/post/main-queue-vs-main-thread/

Copy link
Contributor Author

@chliangGoogle chliangGoogle Oct 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it for now. Also realize we don't set DEBUG flag anymore so this would be barely used.

@chliangGoogle chliangGoogle merged commit 28038e5 into master Oct 10, 2019
2 checks passed
@chliangGoogle chliangGoogle deleted the oct-fcm-database branch Oct 10, 2019
@firebase firebase locked and limited conversation to collaborators Nov 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants