Skip to content
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

v2 backend: remove or replace putClientSettings endpoint #1973

Closed
rjhuijsman opened this issue Mar 30, 2021 · 1 comment · Fixed by #1981
Closed

v2 backend: remove or replace putClientSettings endpoint #1973

rjhuijsman opened this issue Mar 30, 2021 · 1 comment · Fixed by #1981
Assignees
Labels
needs:triage New issue that needs triage source:public Issues created by the public

Comments

@rjhuijsman
Copy link
Contributor

Summary

Currently, the putClientSettings endpoint that's part of the v1 API is available in the v2 backend as a HTTPS Cloud Function. However, that doesn't track with how we'd like to client-backend interaction; we'd like to move towards direct use of Firestore by the client, without a custom API layer in between.

In addition, the FCM token being updated through this call (its reason for existing) isn't currently being used - we should discuss the future of this functionality.

Desired Solution

We'd like to:

  1. Discuss whether the FCM token logic has a reason to exist in the project, or whether we should remove this functionality entirely. If the FCM token won't have a use at all, we should remove this functionality instead of doing the things below. If the FCM token does have a use...
  2. Replace the putClientSettings API with direct Firestore access.
  3. Implement the clientSettingsUpdated Cloud Function with the logic to use the FCM token as desired.

Additional Context

Cloud Functions live in app/server/functions/src/index.ts.

To allow for direct access to Firestore, we will need to update our firestore.rules. Please also update the unit tests in firestore_rules.spec.ts to show what clients should and should not be allowed to do under the new rules.

@rjhuijsman rjhuijsman added needs:triage New issue that needs triage source:public Issues created by the public labels Mar 30, 2021
@rjhuijsman
Copy link
Contributor Author

Blocked by #1971

@rjhuijsman rjhuijsman self-assigned this Apr 7, 2021
rjhuijsman added a commit that referenced this issue Apr 14, 2021
Before this PR, we would update the client's FCM token by writing to the putClientSettings HTTPS endpoint. With this PR, we remove that intermediate API layer and write directly to Firestore.

We don't currently use the FCM token, so the main purposes of this PR are to...
* Demonstrate how we'll perform direct Firestore access.
* Demonstrate how to configure the app to use the local Firebase (Firestore) emulator.
* Prepare the application for later use of the FCM token.

Closes #1973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:triage New issue that needs triage source:public Issues created by the public
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant