We are transitioning the backend from a fixed, 15min featurization schedule to a Firestore listener-based schedule (see this PR for progress). As part of this migration, we have set up a listener on the studies/STUDY_ID/users collection to monitor new users. This listener is not triggered by changes to the users collection, as this would trigger on every single data upload to any user. Instead, I propose adding a created_at timestamp to each user document, and having the listener trigger on the query: new_user_query = users_ref.where(filter=FieldFilter('created_at', '>', self.last_query_time)).
However, this field is not automatically created for new users. This PR adds functionality to the iOS app to set the field appropriately upon account creation.
:gear: Release Notes
Added a new function PrismaStandard.setAccountTimestamp() that writes the current time to the created_at field in the user's document
Call standard.setAccountTimestamp() in the AccountOnboarding continuation
:books: Documentation
Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.
:white_check_mark: Testing
Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.This section describes important information about the tests and why some elements might not be testable.
:pencil: Code of Conduct & Contributing Guidelines
Timestamp for New Account Creation
:recycle: Current situation & Problem
We are transitioning the backend from a fixed, 15min featurization schedule to a Firestore listener-based schedule (see this PR for progress). As part of this migration, we have set up a listener on the
studies/STUDY_ID/users
collection to monitor new users. This listener is not triggered by changes to the users collection, as this would trigger on every single data upload to any user. Instead, I propose adding acreated_at
timestamp to each user document, and having the listener trigger on the query:new_user_query = users_ref.where(filter=FieldFilter('created_at', '>', self.last_query_time))
.However, this field is not automatically created for new users. This PR adds functionality to the iOS app to set the field appropriately upon account creation.
:gear: Release Notes
PrismaStandard.setAccountTimestamp()
that writes the current time to thecreated_at
field in the user's documentstandard.setAccountTimestamp()
in theAccountOnboarding
continuation:books: Documentation
Please ensure that you properly document any additions in conformance to Spezi Documentation Guide. You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.
:white_check_mark: Testing
Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested. This section describes important information about the tests and why some elements might not be testable.
:pencil: Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: