Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a Timestamp for New Account Creation (#24)
# *Timestamp for New Account Creation* ## ♻️ Current situation & Problem We are transitioning the backend from a fixed, 15min featurization schedule to a Firestore listener-based schedule (see this [PR](StanfordHCI/gptcoach-legacy#22) 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. ## ⚙️ 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 ## 📚 Documentation *Please ensure that you properly document any additions in conformance to [Spezi Documentation Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).* *You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.* ## ✅ 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.* ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md).
- Loading branch information