diff --git a/README.md b/README.md index 0c027cd6..6a3532f4 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,6 @@ Coracle is currently in _alpha_ - expect bugs, slow loading times, and rough edg - [ ] Image uploads - [ ] An actual readme - [ ] Server discovery and relay publishing - https://github.com/nostr-protocol/nips/pull/32/files -- [ ] Favorite chat rooms -- [ ] Optimistically load events the user publishes (e.g. to reduce reflow for reactions/replies). - - Essentially, we can pretend to be our own in-memory relay. - - This allows us to keep a copy of all user data, and possibly user likes/reply parents - [ ] Support invoices https://twitter.com/jb55/status/1604131336247476224 # Bugs @@ -47,3 +43,12 @@ Coracle is currently in _alpha_ - expect bugs, slow loading times, and rough edg - https://vitejs.dev/guide/features.html#web-workers - https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers - https://web.dev/module-workers/ + +- [ ] Sync user +- [ ] Based on petnames, sync network to 2 or 3 degrees of separation +- [ ] Main fetch requests: + - Fetch network, including feed + - Fetch person, including feed + - Fetch note, including context + - This is based on detail pages. Each request should check local db and fall back to network, all within an await. +- [ ] How will newcomers get followed? diff --git a/src/relay/index.js b/src/relay/index.js index 2a3a539f..d11a3436 100644 --- a/src/relay/index.js +++ b/src/relay/index.js @@ -139,7 +139,7 @@ const findReaction = async (id, filter) => const countReactions = async (id, filter) => (await filterReactions(id, filter)).length -const findNote = async (id, giveUp = false) => { +const findNote = async (id, {giveUp = false, showEntire = false} = {}) => { const [note, children] = await Promise.all([ db.events.get(id), db.events.where('reply').equals(id), @@ -155,14 +155,14 @@ const findNote = async (id, giveUp = false) => { await ensureContext(await pool.loadEvents({ids: [id]})) - return findNote(id, true) + return findNote(id, {giveUp: true}) } const [replies, reactions, person, html] = await Promise.all([ children.clone().filter(e => e.kind === 1).toArray(), children.clone().filter(e => e.kind === 7).toArray(), db.people.get(note.pubkey), - renderNote(note, {showEntire: false}), + renderNote(note, {showEntire}), ]) return {