question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reactivity issue: Linked data is not always up to date

See original GitHub issue

Hi!

I have an invoice collection and a lineitem collection which is linked with the invoice.

When I do operations in a single server method that changes data in the invoice AND in the line items (like removing a lineitem which changes the invoice sum on the invoice and manipulating the order fields on every lineitem), sometimes the latest changes within the linked collection are not reflected on the client.

@theodorDiaconu Means the data in the mongodb is correct, but I didn’t get the latest change from the linked collection.

My code:

(invoiceCollection as any).addLinks({
    customer: {
        type: 'one',
        collection: customerCollection,
        field: 'customerId',
        denormalize: {
            field: 'customerCache',
            body: {
                name: 1,
                name2: 1
            }
        }
    },
    template: {
        type: 'one',
        collection: invoiceTemplateCollection,
        field: 'templateId'
    },
    invoiceElements: {
        collection: invoiceElementCollection,
        inversedBy: 'invoice'
    },
    invoiceLineItems: {
        collection: invoiceLineItemCollection,
        inversedBy: 'invoice'
    }
});
(invoiceLineItemCollection as any).addLinks({
    invoice: {
        type: 'one',
        collection: invoiceCollection,
        field: 'invoiceId'
    }
});

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
theodorDiaconucommented, May 7, 2018

Thank you very much @hoebbelsB . I will be looking at this Wednesday.

0reactions
stefanholzapfelcommented, Oct 26, 2018

@theodorDiaconu Sorry, I quit meteor in the meantime and wrote my own AsyncIterator for GraphQL Subscriptions (using Mongo ChangeStreams) to get rid of the limitations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reactivity on Variables Not Associated With Data, Computed ...
Any data that is not reactive will not be tracked. Updating that data will not cause a re-render, won't update computed properties and...
Read more >
Common problems with reactivity · Issue #849 · vuejs/docs
This is an umbrella issue, intended to gather examples of common problems, mistakes and misunderstandings when using the proxy-based ...
Read more >
Linked Data - Design Issues - W3C
Linked Data. The Semantic Web isn't just about putting data on the web. It is about making links, so that a person or...
Read more >
Why Your Vue Component Isn't Updating (and how to fix it)
Here are some links if you want to jump right in: Check that variables are reactive; Make sure to update Arrays and Objects...
Read more >
Reactivity Fundamentals - Vue.js
These instance properties are only added when the instance is first created, so you need to ensure they are all present in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found