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 # 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 ## 0.2.17
- [x] Make "show new notes" button fixed position - [x] Make "show new notes" button fixed position

View File

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

View File

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

View File

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