Skip to content

[FirebaseCoreInternal] Sanitize app ID used in file system resource #9683

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

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Apr 21, 2022

Context

  • The name of an app's heartbeats storage file includes the Firebase app ID. Since the Firebase app ID includes the ":" character, the filename also contains a ":".

    This works on Apple's latest filesystem but it's safer to replace each ":" with a "_"

  • In practice, this code change will cause the below diff in an app's container:

    📂 Application Support/
    └── 📂 google-heartbeat-storage/
    -    └── 📄 heartbeats-1:123456789000:ios:abcdefghijklmnop
    +    └── 📄 heartbeats-1_123456789000_ios_abcdefghijklmnop
  • Also, resolved outstanding TODOs in FirebaseCoreInternal.

#no-changelog

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

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

Should there be a test for no colon's in the id?

Should this PR go into Firebase 9?

@ncooke3 ncooke3 requested a review from paulb777 April 21, 2022 20:18
Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

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

Thanks!

@google-oss-bot
Copy link

google-oss-bot commented Apr 21, 2022

Coverage Report 1

Affected Products

  • FirebaseFirestore-iOS-FirebaseFirestore.framework

    Overall coverage changed from 86.75% (916759e) to 86.79% (6c6486f) by +0.04%.

    FilenameBase (916759e)Merge (6c6486f)Diff
    exception.cc23.68%73.68%+50.00%
    exception_apple.mm89.66%58.62%-31.03%
    leveldb_key.cc98.38%98.60%+0.22%
    write_stream.cc94.37%90.14%-4.23%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Jg9hFFhTPm.html

@ncooke3 ncooke3 merged commit 502780e into master Apr 21, 2022
@ncooke3 ncooke3 deleted the nc/heartbeat-filename branch April 21, 2022 21:28
@firebase firebase locked and limited conversation to collaborators May 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants