If you have a data structure like this:

<https://lh4.googleusercontent.com/-hc2lEyRG6IE/VLYmZF-ZJFI/AAAAAAAACXM/v5v0jMHPDZo/s1600/wYu88.png>
and for example retrieve data startAt("20150101").endAt("20150105") to a
variable: "data". Then it is possible to accidentally delete the data in
updating root "20141231", by making changes and saving the whole root to
firebase, eventhough that action shouldn't even happen when using this
retrieved scope. Now this can be handled from app-layer, by not making the
action or making manual updates or checks for it, it's in no way firebase
bug, but a feature. My question is that is it possible to prevent this
kinda behaviour / action or is it possibily upcoming? In production a small
bug can easily make a lot of damage, if a bug like this gets in.
Fortunately the app I noticed the issue in hasn't made production yet :).

I noticed that in angular it can be quite a pain-in-the-ass, if you 3-way
bind a data using startAt and endAt, then you accidentally alter data
outside that scope. What happens is that even though I try to update the
data and not delete, it naturally deleted the data that hasn't been fetched
and binded to angular variable.

--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/9cf56ae4-cf78-4820-8d56-73afa1c16df0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Kato Richardson at Jan 15, 2015 at 3:22 pm
    Hello Janne,

    Great to hear from you.

    $bindTo is not the right tool for the use case you've described here.
    You'll want to use $asArray() and update the individual records as they
    change.

    Cheers,
    Kato

    On Wed, Jan 14, 2015 at 1:29 AM, Janne Hyytiä wrote:

    If you have a data structure like this:


    <https://lh4.googleusercontent.com/-hc2lEyRG6IE/VLYmZF-ZJFI/AAAAAAAACXM/v5v0jMHPDZo/s1600/wYu88.png>
    and for example retrieve data startAt("20150101").endAt("20150105") to a
    variable: "data". Then it is possible to accidentally delete the data in
    updating root "20141231", by making changes and saving the whole root to
    firebase, eventhough that action shouldn't even happen when using this
    retrieved scope. Now this can be handled from app-layer, by not making the
    action or making manual updates or checks for it, it's in no way firebase
    bug, but a feature. My question is that is it possible to prevent this
    kinda behaviour / action or is it possibily upcoming? In production a small
    bug can easily make a lot of damage, if a bug like this gets in.
    Fortunately the app I noticed the issue in hasn't made production yet :).

    I noticed that in angular it can be quite a pain-in-the-ass, if you 3-way
    bind a data using startAt and endAt, then you accidentally alter data
    outside that scope. What happens is that even though I try to update the
    data and not delete, it naturally deleted the data that hasn't been fetched
    and binded to angular variable.

    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/9cf56ae4-cf78-4820-8d56-73afa1c16df0%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/9cf56ae4-cf78-4820-8d56-73afa1c16df0%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CADypTEbc0CCwJ97EN1tK5C_yYwZ3gv0HDNf_1ZEE%2BJ-c3rTKJg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedJan 14, '15 at 9:42p
activeJan 15, '15 at 3:22p
posts2
users2

2 users in discussion

Kato Richardson: 1 post Janne Hyytiä: 1 post

People

Translate

site design / logo © 2021 Grokbase