-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update nostrdb-rs for async stream support #584
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling num_enum v0.7.3 error[E0463]: can't find crate for `num_enum_derive`
On Mon, Dec 16, 2024 at 04:50:44PM GMT, Ken Sedgwick wrote:
Closes: #584
---
crates/notedeck/src/context.rs | 2 +-
crates/notedeck_chrome/src/app.rs | 2 +-
crates/notedeck_columns/src/multi_subscriber.rs | 2 +-
crates/notedeck_columns/src/nav.rs | 2 +-
crates/notedeck_columns/src/notes_holder.rs | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
Looks good!
Patches 1-4
Reviewed-by: William Casarin ***@***.***>
…
diff --git a/crates/notedeck/src/context.rs b/crates/notedeck/src/context.rs
index 0280bf8..5863245 100644
--- a/crates/notedeck/src/context.rs
+++ b/crates/notedeck/src/context.rs
@@ -6,7 +6,7 @@ use nostrdb::Ndb;
// TODO: make this interface more sandboxed
pub struct AppContext<'a> {
- pub ndb: &'a Ndb,
+ pub ndb: &'a mut Ndb,
pub img_cache: &'a mut ImageCache,
pub unknown_ids: &'a mut UnknownIds,
pub pool: &'a mut RelayPool,
diff --git a/crates/notedeck_chrome/src/app.rs b/crates/notedeck_chrome/src/app.rs
index 35c0955..bb7f159 100644
--- a/crates/notedeck_chrome/src/app.rs
+++ b/crates/notedeck_chrome/src/app.rs
@@ -162,7 +162,7 @@ impl Notedeck {
pub fn app_context(&mut self) -> AppContext<'_> {
AppContext {
- ndb: &self.ndb,
+ ndb: &mut self.ndb,
img_cache: &mut self.img_cache,
unknown_ids: &mut self.unknown_ids,
pool: &mut self.pool,
diff --git a/crates/notedeck_columns/src/multi_subscriber.rs b/crates/notedeck_columns/src/multi_subscriber.rs
index 27fb952..c1eed12 100644
--- a/crates/notedeck_columns/src/multi_subscriber.rs
+++ b/crates/notedeck_columns/src/multi_subscriber.rs
@@ -37,7 +37,7 @@ impl MultiSubscriber {
})
}
- pub fn unsubscribe(&mut self, ndb: &Ndb, pool: &mut RelayPool) {
+ pub fn unsubscribe(&mut self, ndb: &mut Ndb, pool: &mut RelayPool) {
if self.subscribers == 0 {
error!("No subscribers to unsubscribe from");
return;
diff --git a/crates/notedeck_columns/src/nav.rs b/crates/notedeck_columns/src/nav.rs
index 127ef6f..c6afc73 100644
--- a/crates/notedeck_columns/src/nav.rs
+++ b/crates/notedeck_columns/src/nav.rs
@@ -407,7 +407,7 @@ pub fn render_nav(
RenderNavResponse::new(col, nav_response)
}
-fn unsubscribe_timeline(ndb: &Ndb, timeline: &Timeline) {
+fn unsubscribe_timeline(ndb: &mut Ndb, timeline: &Timeline) {
if let Some(sub_id) = timeline.subscription {
if let Err(e) = ndb.unsubscribe(sub_id) {
error!("unsubscribe error: {}", e);
diff --git a/crates/notedeck_columns/src/notes_holder.rs b/crates/notedeck_columns/src/notes_holder.rs
index 7bd8ad1..f5d4536 100644
--- a/crates/notedeck_columns/src/notes_holder.rs
+++ b/crates/notedeck_columns/src/notes_holder.rs
@@ -155,7 +155,7 @@ pub trait NotesHolder {
/// Local NotesHolder unsubscribe
fn unsubscribe_locally<M: NotesHolder>(
txn: &Transaction,
- ndb: &Ndb,
+ ndb: &mut Ndb,
note_cache: &mut NoteCache,
notes_holder_storage: &mut NotesHolderStorage<M>,
pool: &mut RelayPool,
|
jb55
pushed a commit
that referenced
this pull request
Dec 17, 2024
jb55
pushed a commit
that referenced
this pull request
Dec 17, 2024
jb55
pushed a commit
that referenced
this pull request
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR requires the updated nostrdb-rs with async stream support.