Skip to content

Commit

Permalink
[CORL-1281] Prevent viewNewEdges from being garbage collected (#3121)
Browse files Browse the repository at this point in the history
* fix: prevent viewNewEdges from being garbage collected

* fix: add local data to optimistic responses

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Wyatt Johnson <wyattjoh@gmail.com>
  • Loading branch information
3 people committed Aug 20, 2020
1 parent 7cbc47b commit e701628
Show file tree
Hide file tree
Showing 8 changed files with 1,241 additions and 673 deletions.
1,868 changes: 1,198 additions & 670 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -335,7 +335,7 @@
"react-final-form-arrays": "^3.1.1",
"react-helmet": "^5.2.1",
"react-popper": "^1.3.7",
"react-relay": "^9.0.0",
"react-relay": "^10.0.1",
"react-relay-network-modern": "^4.6.1",
"react-responsive": "^8.0.3",
"react-test-renderer": "^16.13.1",
Expand All @@ -344,10 +344,10 @@
"recharts": "^1.8.5",
"recompose": "^0.30.0",
"regenerator-runtime": "^0.13.5",
"relay-compiler": "^9.0.0",
"relay-compiler": "^10.0.1",
"relay-compiler-language-typescript": "^12.0.3",
"relay-local-schema": "^0.8.0",
"relay-runtime": "^9.0.0",
"relay-runtime": "^10.0.1",
"resize-observer-polyfill": "^1.5.1",
"sane": "^4.1.0",
"shallow-equals": "^1.0.0",
Expand Down
4 changes: 4 additions & 0 deletions src/core/client/admin/routes/Moderate/Queue/QueueRoute.tsx
Expand Up @@ -199,6 +199,10 @@ const createQueueRoute = (
@connection(key: "Queue_comments") {
viewNewEdges {
cursor
node {
id
...ModerateCardContainer_comment
}
}
edges {
node {
Expand Down
Expand Up @@ -209,6 +209,8 @@ async function commit(
id,
createdAt: currentDate,
status: "NONE",
pending: false,
lastViewerAction: null,
author: {
id: viewer.id,
username: viewer.username,
Expand Down Expand Up @@ -258,6 +260,7 @@ async function commit(
},
replies: {
edges: [],
viewNewEdges: [],
pageInfo: { endCursor: null, hasNextPage: false },
},
deleted: false,
Expand Down
Expand Up @@ -286,6 +286,14 @@ const ReplyListContainer3 = createReplyListContainer(
@connection(key: "ReplyList_replies") {
viewNewEdges {
cursor
node {
id
replyCount
enteredLive
...CommentContainer_comment
...IgnoredTombstoneOrHideContainer_comment
...LocalReplyListContainer_comment
}
}
edges {
node {
Expand Down Expand Up @@ -366,6 +374,13 @@ const ReplyListContainer2 = createReplyListContainer(
@connection(key: "ReplyList_replies") {
viewNewEdges {
cursor
node {
id
enteredLive
...CommentContainer_comment
...IgnoredTombstoneOrHideContainer_comment
...ReplyListContainer3_comment
}
}
edges {
node {
Expand Down Expand Up @@ -445,6 +460,13 @@ const ReplyListContainer1 = createReplyListContainer(
@connection(key: "ReplyList_replies") {
viewNewEdges {
cursor
node {
id
enteredLive
...CommentContainer_comment
...IgnoredTombstoneOrHideContainer_comment
...ReplyListContainer2_comment
}
}
edges {
node {
Expand Down
Expand Up @@ -297,6 +297,10 @@ const enhanced = withPaginationContainer<
@connection(key: "Stream_comments") {
viewNewEdges {
cursor
node {
enteredLive
...AllCommentsTabContainer_comment @relay(mask: false)
}
}
edges {
node {
Expand Down
Expand Up @@ -196,6 +196,8 @@ async function commit(
id,
createdAt: currentDate,
status: "NONE",
pending: false,
lastViewerAction: null,
author: {
id: viewer.id,
username: viewer.username,
Expand Down Expand Up @@ -231,6 +233,7 @@ async function commit(
},
replies: {
edges: [],
viewNewEdges: [],
pageInfo: { endCursor: null, hasNextPage: false },
},
story: {
Expand Down
Expand Up @@ -250,6 +250,10 @@ const enhanced = withPaginationContainer<
@connection(key: "UnansweredStream_comments") {
viewNewEdges {
cursor
node {
enteredLive
...UnansweredCommentsTabContainer_comment @relay(mask: false)
}
}
edges {
node {
Expand Down

0 comments on commit e701628

Please sign in to comment.