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

ensure getlinkedRecord is truthy before retrieving value in queue subscription #3111

Closed
wants to merge 1 commit into from

Conversation

tessalt
Copy link
Contributor

@tessalt tessalt commented Aug 17, 2020

Ok I'm not sure this is actually the real problem but this addresses the cannot call getValue on undefined error was seeing in prod on clicking "view x new comments" in the moderation queue.
Screen Shot 2020-08-17 at 12 43 38 PM

why was the ! used in the first place, is there a reason getLinkedRecord should always be truthy here that I'm missing? If it's undefined, what could that mean? much to discuss, maybe

@tessalt tessalt requested review from cvle and wyattjoh August 17, 2020 16:54
Comment on lines +38 to +39
r.getLinkedRecord("node") &&
r.getLinkedRecord("node")!.getValue("id") !== commentID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can actually write this as:

Suggested change
r.getLinkedRecord("node") &&
r.getLinkedRecord("node")!.getValue("id") !== commentID
r.getLinkedRecord("node")?.getValue("id") !== commentID

Though this is related already to the issue that @cvle is already assigned (CORL-1281), so we might need to wait for this fix.

@kgardnr kgardnr changed the title ensure getlinkedRecord is truthy before retrieving value in queue subcsription ensure getlinkedRecord is truthy before retrieving value in queue subscription Aug 17, 2020
@kgardnr kgardnr added this to the v6.3.3 milestone Aug 17, 2020
@cvle
Copy link
Member

cvle commented Aug 18, 2020

I'm looking into this already, there is probably more to it.

@cvle cvle closed this Aug 18, 2020
@wyattjoh wyattjoh deleted the bugfix/live-comment-updates branch January 5, 2021 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants