July 2017 Summaries
6 posts from Firebase
Filter
Month:
Year:
Post Summaries
Back to Blog
Firebase Realtime Database added conditional requests to its REST API, enabling clients to safely update shared values without losing changes caused by concurrent writes. The feature addresses race conditions such as multiple users incrementing a video’s upvote count after reading the same initial value, where ordinary read-modify-write operations could overwrite one another. Clients first retrieve data along with an ETag, then send a PUT request containing the updated value and an if-match header with that ETag; the update succeeds only if the stored data has not changed in the meantime. If another update occurred, the request fails and returns the latest data and ETag, allowing the client to recalculate the value and retry. This approach follows the HTTP Compare and Swap pattern and provides a REST-based alternative to transactions already available in Firebase’s mobile and web SDKs.
Jul 31, 2017
511 words in the original blog post.
Android’s StrictMode API can help identify difficult-to-reproduce bugs and performance issues, such as blocking disk I/O on the main thread or leaked Activity references, before they affect production users. By configuring ThreadPolicy and VmPolicy to detect all violations, log them, and terminate the app, developers can treat these problems as test failures; this behavior is typically limited to debug builds to avoid crashing production apps. Extending the condition to recognize Firebase Test Lab devices through the `firebase.test.lab` system setting allows instrumented and Robo tests to expose StrictMode violations in Test Lab reports. Logs can then pinpoint the offending code, such as an Activity calling `getSharedPreferences()` during `onCreate()`, which may cause main-thread filesystem access and interface jank. The approach also allows nonfatal policies or narrower detection settings when violations are known but cannot yet be fixed, while noting that early initialization may require workarounds on some Android versions.
Jul 27, 2017
1,195 words in the original blog post.
Firebase Cloud Functions for Realtime Database introduced dedicated onCreate(), onUpdate(), and onDelete() triggers in firebase-functions version 0.5.9, supplementing the existing onWrite() trigger that fires for all data changes. Previously, developers using onWrite() had to inspect event snapshots to distinguish new data from updates or deletions, which could lead to unnecessary function executions and costs. The new triggers run only for their specified change type, simplifying functions such as sending notifications when chat messages are created. Developers should still account for possible infinite loops when onWrite() or onUpdate() functions write back to the same database location, typically by adding conditions that prevent repeated updates.
Jul 10, 2017
774 words in the original blog post.
AppShip3000 is a three-player collaborative rocket-flying trivia game created for Google I/O to demonstrate how Firebase can support game infrastructure. Players must communicate to answer questions, avoid asteroids, and conserve fuel because each participant sees only partial information, such as a question, an answer option, or incoming hazards. The game uses Firebase Authentication to sign players into a progressive web app with Google accounts, while Cloud Functions generate launch codes that connect players to game controllers and associate results with their accounts. Firebase Realtime Database manages live leaderboards and trivia content, enabling immediate score updates and rapid question changes between games. Cloud Storage saves a souvenir image of each rocket’s flight path, and a Cloud Function triggers Firebase Cloud Messaging notifications that encourage players to view and share the image.
Jul 07, 2017
560 words in the original blog post.
Firebase announced Realtime Database support in version 2.1.0 of its Python Admin SDK, expanding on the SDK’s existing Firebase Authentication capabilities for custom token creation and ID token verification. Developers can initialize the SDK with service-account credentials and a database URL, then use database references to retrieve, create, update, push, and delete JSON-backed data, with automatic conversion to native Python types. The API also supports advanced sorted, range, and limit queries through order-by methods, but differs from the Node.js and Java Admin SDKs because it does not support realtime event listeners; instead, all retrieval operations are blocking. Firebase encouraged developers to consult the documentation and GitHub repository, contribute patches, and report issues.
Jul 06, 2017
551 words in the original blog post.
Firebase Test Lab for Android offers several testing options, including instrumented and unit tests, Espresso Test Recorder, and automated Robo tests, but these approaches are often ineffective for games that use custom interfaces and touch controls rather than standard Android widgets. To address this, Test Lab introduced the beta Game Loop Test, which lets developers create automated “attract mode” scenarios that run sequentially across supported devices, covering multiple levels and gameplay situations in one test session. Reports identify problematic scenarios and include performance data such as rendered frame rate synchronized with device video, enabling developers to locate visual performance issues, along with CPU, memory, and network usage metrics.
Jul 05, 2017
491 words in the original blog post.