Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Fix security rules validation for updates #99

Merged
merged 1 commit into from
Aug 1, 2017
Merged

Fix security rules validation for updates #99

merged 1 commit into from
Aug 1, 2017

Conversation

dotdoom
Copy link
Contributor

@dotdoom dotdoom commented Aug 1, 2017

  • updates can go into empty nodes: they will be created
    (thus || {} shortcut)
  • updates can be selective, so we have to use tryPatch instead of
    tryWrite

More on updates:
https://firebase.google.com/docs/database/web/read-and-write#update_specific_fields

* updates can go into empty nodes: they will be created
  (thus `|| {}` shortcut)
* updates can be selective, so we have to use tryPatch instead of
  tryWrite

More on updates:
https://firebase.google.com/docs/database/web/read-and-write#update_specific_fields
@coveralls
Copy link

coveralls commented Aug 1, 2017

Coverage Status

Coverage decreased (-0.2%) to 96.764% when pulling b4a97da on dotdoom:firebase-patch into 06f008b on urish:master.

@dotdoom
Copy link
Contributor Author

dotdoom commented Aug 1, 2017

I suspect the coverage drop is because of Promise.resolve(true) line not being tested:
https://coveralls.io/builds/12641861/source?filename=index.js#L184

This code is a safeguard, unreachable with the current implementation (the presence of ruleset is already checked in handleUpdate before calling tryPatch). I'm open to any suggestions (as well as leaving it as-is).

@urish urish merged commit 0c86771 into urish:master Aug 1, 2017
@urish
Copy link
Owner

urish commented Aug 1, 2017

Thanks!

@urish
Copy link
Owner

urish commented Aug 19, 2017

released as 0.11.0

p-salido pushed a commit to p/firebase-server that referenced this pull request Oct 3, 2017
* origin/master:
  chore: release 0.11.0
  chore: add package-lock.json
  doc: add a note about `-s` argument
  doc: add link to explain tryRead() issue
  Migrate to Targaryen 3 (urish#100)
  Support passing a WebSocket.Server options object to the FirebaseServer constructor (urish#101)
  Fix security rules validation for updates (urish#99)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants