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

Can't delete all elements with a falcor call #813

Open
emilgoldsmith opened this issue Oct 6, 2016 · 4 comments
Open

Can't delete all elements with a falcor call #813

emilgoldsmith opened this issue Oct 6, 2016 · 4 comments
Labels

Comments

@emilgoldsmith
Copy link
Contributor

When implementing a falcor call, falcor will timeout if you don't return any path-value objects. But in my case I for example have a function (in a newspaper website) called updateAuthors, which gets a new array of the authors of an article and then updates the values accordingly. Right now if that update is removing all authors, falcor will timeout as there won't be any new values returned, just an invalidate.

As my falcor call implementation is also what updates the database it would be stupid if I had to rewrite that code in the app part of my code in the special case someone wants to delete all the authors of an article temporarily (or other cases where I want to return nothing after an update).

Is it because I'm using bad form by returning invalidated: true on all of that, and should instead for every single value return a null value or undefined or something along the likes of that?

The only (extremely hacky) solution I can think of right now is to make a bogus path "placeholder" or whatever, and make all my call functions update that one.

@sdesai
Copy link
Contributor

sdesai commented Nov 2, 2016

You should be able to return just invalidations in response to a call, without any path values. We did have a bug at one point, which didn't handle this case correctly, but I believe the issue should be fixed: #589 (comment)

If you can provide some more repro context, we can figure out where the disconnect may be.

@emilgoldsmith
Copy link
Contributor Author

Okay I'll update to the newest falcor version, check it out and get back to you when I've checked if that solves it. Thanks.

@emilgoldsmith
Copy link
Contributor Author

Sorry for being slow @sdesai I have the newest version of falcor 0.1.17 and I still do have this error.

const results = [
            {
              path: ['placeholder'],
              value: 'placeholder',
            },
            {
              path: ['issuesByNumber', issueNumber, 'categories'],
              invalidated: true,
            },
          ];
          resolve(results);

works but without the setting the value of the placeholder the call times out.

And my call looks like model.call([pathArray], [one argument], [], []).then()...

@steveorsomethin
Copy link
Contributor

I'm currently performing issue triage as we get ready to perform a proper release, and closing/tagging as I go.

We'll look into this one further soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants