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.

Enriched reactions

See original GitHub issue

Hi there,

I’d like to know if getStream feeds support the enrichment of reactions, because I’d like to store references to objects like author inside the reaction and have it enriched automatically as I can do with activities.

I tried to store objects (created from collections.add) inside a reaction’s data but I wasn’t able because an error was thrown. So I’m not sure if this is an error, or if this is something that you don’t support.

To store objects inside reactions I was doing this

const author = await client.collections.add('authors', null, { 
        name: 'Author',
    })

await client.reactions.add("comment", activity.id, { text: "nice post!", author }, { userId: user.id })

But then the following is error was being thrown

Error: Converting circular structure to JSON –> starting at object with constructor ‘StreamClient’ | property ‘personalization’ -> object with constructor ‘Personalization’ — property ‘client’ closes the circle

Instead of adding the full author object to the reaction, I was able to add author.id and also author.data, but that way the object will not be enriched / updated once the author is updated

But first I’d need to know if getStream supports or not enriched reactions

I’m using latest version (8.0.0)

Thanks

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
luantraselcommented, Apr 8, 2022

@ferhatelmas it worked

I was trying to send the whole object because when I add this way on activities it works.

Thank you!

0reactions
ferhatelmascommented, Apr 20, 2022

There is a problem in your example because you’re calling addChild which means you’re trying to add a comment to existing comment but parent of your response is empty so it’s a comment on activity. That’s why that response isn’t coming that request.

Problem is here:

const reactionId = activityId || commentId;

if activityId exists you need to call client.reactions.add, otherwise call client.reaction.addChild.

Overall, you’re adding custom data, not a reference and you don’t want to enrich it. I believe, your issue is irrelevant to this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Synthesis of Enantiomerically Enriched Triarylmethanes by ...
The Suzuki–Miyaura cross-coupling of chiral, enantiomerically enriched dibenzylic boronic esters is described. The reaction proceeds with ...
Read more >
Influence of enriched 100Mo on Mo reaction yields - IOPscience
In the 100 Mo(p,2n) 99m Tc reaction route, the use of >99%-enriched 100 Mo is required to minimize the production of Tc isotopes...
Read more >
Synthesis of enantiomerically enriched ... - PubMed
The Suzuki-Miyaura cross-coupling of chiral, enantiomerically enriched dibenzylic boronic esters is described. The reaction proceeds with ...
Read more >
Synthesis of 13 C-enriched amino acids with 13 C-depleted ...
Isotope fractionation in ammonia-involved formose-type reactions ... Moreover, the 13 C enrichment in the residue of a successive reaction via KIE was ...
Read more >
Asymmetric C(sp3)-H/C(Ar) coupling reactions. Highly enantio ...
Asymmetric C(sp 3 )-H/C(Ar) coupling reactions. Highly enantio-enriched indolines via regiodivergent reaction of a racemic mixture†.
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