Fix sync bug

This commit is contained in:
Jonathan Staab 2023-03-15 11:00:12 -05:00
parent 9a8f6f0222
commit 059eb174f0
4 changed files with 17 additions and 12 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## 0.2.18
- [x] Re-write data storage layer to conserve memory using LRU cache
- [x] Fix bugs with handling invalid keys
- [x] Improve pubkey/anonymous login
- [x] Generate placeholder profile images (@morkowski)
## 0.2.17
- [x] Make "show new notes" button fixed position

View File

@ -1,8 +1,10 @@
# Current
- [ ] Test migration
- [ ] Fix notifications
- [ ] Add quotes to notifications
- [ ] Show loading/success on zap invoice screen
- [ ] Fix iOS/safari/firefox
- [ ] Add quotes to notifications
# Coracle website

View File

@ -45,7 +45,7 @@ const load = ({relays, filter, onChunk = null, shouldProcess = true, timeout = 5
const done = new Set()
const allEvents = []
const attemptToComplete = async isTimeout => {
const attemptToComplete = async force => {
const sub = await subPromise
// If we've already unsubscribed we're good
@ -55,7 +55,7 @@ const load = ({relays, filter, onChunk = null, shouldProcess = true, timeout = 5
const isDone = done.size === relays.length
if (isTimeout) {
if (force) {
const timedOutRelays = reject(r => done.has(r.url), relays)
log(
@ -72,7 +72,7 @@ const load = ({relays, filter, onChunk = null, shouldProcess = true, timeout = 5
})
}
if (isDone || isTimeout) {
if (isDone || force) {
sub.unsub()
resolve(allEvents)
}

View File

@ -67,14 +67,10 @@ const verifyNip05 = (pubkey, as) =>
relays.bulkPatch(urls.map(url => ({url: normalizeRelayUrl(url)})))
routes.bulkPut(
urls
.flatMap(url => [
addRoute(pubkey, url, "nip05", "write", now()),
addRoute(pubkey, url, "nip05", "read", now()),
])
.filter(identity)
)
urls.forEach(url => {
addRoute(pubkey, url, "nip05", "write", now())
addRoute(pubkey, url, "nip05", "read", now())
})
}
}
}, noop)