Comments (7)
I think this is the cause:
I encountered this error while working on #1184 but I thought it was part of my postpaid changes which weren't included in #1194
from stacker.news.
I can reliably reproduce the comment not showing up when I zap the parent first. But the cache warning does not show up. So maybe it's unrelated or another issue. I can't reproduce the cache warning.
from stacker.news.
If I uncomment the optimistic mutation code, it appears to fix it.
from stacker.news.
This also seems to fix it (at least for successful zaps):
diff --git a/components/item-act.js b/components/item-act.js
index 29babfd4..f4e360e1 100644
--- a/components/item-act.js
+++ b/components/item-act.js
@@ -277,7 +277,7 @@ export function useZap () {
let hash, hmac;
[{ hash, hmac }, cancel] = await payment.request(satsDelta)
- await zap({ variables: { ...variables, hash, hmac } })
+ await zap({ variables: { ...variables, hash, hmac }, optimisticResponse, update })
} catch (error) {
revert?.()
diff --git a/lib/apollo.js b/lib/apollo.js
index d950ed68..17296bc1 100644
--- a/lib/apollo.js
+++ b/lib/apollo.js
@@ -259,7 +259,7 @@ function getClient (uri) {
export function optimisticUpdate ({ mutation, variables, optimisticResponse, update }) {
const { cache, queryManager } = getApolloClient()
- const mutationId = String(queryManager.mutationIdCounter++)
+ const mutationId = String(queryManager.mutationIdCounter)
queryManager.markMutationOptimistic(optimisticResponse, {
mutationId,
document: mutation,
But only removing ++
does not.
I added the ++
in a38dc10 for zap undos because iirc, not using ++
meant that the optimistic update for all zaps were undone when one zap was aborted.
Zap undos are lot less important than comments working properly but I'd like to find out if there's a way to get both working. I'd also like to find out what's actually happening instead of speculating why ++
breaks following mutations.
from stacker.news.
All mutations share the queryManager. So not incrementing it means all mutations would share that mutationId.
from stacker.news.
I'm sending you messages in chat. Have you figured that out yet?
from stacker.news.
Closing because fixed in #1220
from stacker.news.
Related Issues (20)
- Expired invoices can show as pending after expiration HOT 2
- Encountered a small edge case with autowithdraw HOT 1
- Bottom navigation bar on mobile (PWA) doesn't stick to bottom when scrolling up
- "go back to wallet" after successful withdrawals or deposits HOT 4
- Retroactive remindme
- Wallet: Pay to NIP-69 Nostr Offer STRings HOT 1
- Timeout createInvoice for slow receiving wallets
- Surface all relevant payment details in wallet logs
- Retry invoice sometimes not found
- For wallet errors (toasts specifically) distinguish between what is SN's fault and a stacker's wallet's fault
- Allow to set max base fee for withdrawals
- Zap responses still race to update client cache
- For exact search matches, standard analyzer should be used
- Show referees somewhere
- Don't let media/embeds appear inline in a text node
- It's still possible to disguise links as other links
- non-custodial zap failures on bounty comments say "bounty payment failed" even if not OP
- WSS prefix issue
- Territory subscription management UI
- New post type: Series
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stacker.news.