Skip to content

Conversation

@paulb777
Copy link
Member

Fix #14880

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@paulb777
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a crash on app launch related to the FCM database. The changes correctly ensure that the database directory exists before attempting to create the database file, which was the likely cause of the crash. The logic for opening the database has also been refactored for clarity and robustness, including a new mechanism to handle potentially corrupt database files by deleting them. I've included one minor suggestion to improve error logging during this deletion process. Overall, this is a great improvement that should resolve the reported crash.

// If the file existed, it might be corrupt. Let's remove it and fail.
if (fileExists) {
// This is synchronous, but it's on the database queue, so it's safe.
[[NSFileManager defaultManager] removeItemAtPath:path error:nil];
Copy link
Contributor

Choose a reason for hiding this comment

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

low

It's good practice to handle the error that can occur when removing the item at the specified path. While the NSAssert will likely crash the app in debug builds, logging the error from removeItemAtPath:error: can provide valuable diagnostic information, especially in release builds where assertions are disabled and the app might attempt to recover on the next launch.

        NSError *removeError = nil;
        if (![[NSFileManager defaultManager] removeItemAtPath:path error:&removeError]) {
          FIRMessagingLoggerError(kFIRMessagingMessageCodeRmq2PersistentStoreErrorOpeningDatabase,
                                  @"Failed to remove corrupt database file at %@: %@", path,
                                  removeError);
        }

@paulb777 paulb777 requested review from leojaygoogle and ncooke3 and removed request for leojaygoogle and ncooke3 December 1, 2025 14:30
@paulb777 paulb777 marked this pull request as draft December 3, 2025 20:00
@paulb777
Copy link
Member Author

paulb777 commented Dec 3, 2025

More investigation needed. Converted to draft.

Comment on lines -528 to -533
NSString *errorMessage =
[NSString stringWithFormat:@"Could not create RMQ database at path %@, error: %@", path,
errorString];
FIRMessagingLoggerError(kFIRMessagingMessageCodeRmq2PersistentStoreErrorCreatingDatabase,
@"%@", errorMessage);
NSAssert(NO, errorMessage);
Copy link
Member

Choose a reason for hiding this comment

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

More investigation needed. Converted to draft.

From linked issue:

Fatal Exception: NSInternalInconsistencyException
Could not create RMQ database at path /var/mobile/Containers/Data/Application/372D4296-3F35-46FD-B3C9-0A20877B8378/Library/Application Support/Google/FirebaseMessaging/rmq2.sqlite, error: 14 - unable to open database file

This highlighted else clause is where the execution flow reaches the assertion. The assertion's error message is only used here. Entering the else clause means database path exists, so the error has to do with opening a database we know exists in the filesystem.

@paulb777
Copy link
Member Author

paulb777 commented Dec 3, 2025

Closing in favor of #15573

@paulb777 paulb777 closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS App Crashed on app launch - Firebase SQL file not found

3 participants