Skip to content

Dependabot/cargo/mongodb 3.0.1#36

Closed
davidbayo10 wants to merge 1 commit into
maxcountryman:mainfrom
davidbayo10:dependabot/cargo/mongodb-3.0.1
Closed

Dependabot/cargo/mongodb 3.0.1#36
davidbayo10 wants to merge 1 commit into
maxcountryman:mainfrom
davidbayo10:dependabot/cargo/mongodb-3.0.1

Conversation

@davidbayo10

Copy link
Copy Markdown

No description provided.

@maxcountryman

maxcountryman commented Jul 23, 2024

Copy link
Copy Markdown
Owner

This should implement create and I believe that's not easily possible with stock mongo.

See: #16

@davidbayo10

Copy link
Copy Markdown
Author

Updating the MongoDB driver version should be separate from adapting to the new API of Tower Sessions. It shouldn't be coupled together, right?

@maxcountryman

Copy link
Copy Markdown
Owner

I disagree. There's no point in updating a broken implementation. If it can't be implemented then it should be abandoned altogether.

@davidbayo10

Copy link
Copy Markdown
Author

I understand your point, but I'd argue that Tower Sessions doesn't force you to implement the create method, it just recommends it.

async fn create(&self, session_record: &mut Record) -> Result<()> {
    default_create(self, session_record).await
}

async fn default_create<S: SessionStore + ?Sized>(
    store: &S,
    session_record: &mut Record,
) -> Result<()> {
    tracing::warn!(
        "The default implementation of `SessionStore::create` is being used, which relies on \
         `SessionStore::save`. To properly handle potential ID collisions, it is recommended that \
         stores implement their own version of `SessionStore::create`."
    );
    store.save(session_record).await?;
    Ok(())
}

To wrap up and as a possible idea, I think the only way to avoid possible ID collisions is to generate our unique ids. Using UUIDs or MongoDB Object IDs could be enough.

I hope a viable solution could be found.

@maxcountryman

Copy link
Copy Markdown
Owner

It only doesn't require it for compatibility reasons (and in the near future it will be required). But make no mistake: any implementation that doesn't provide create is broken.

Updates the requirements on [mongodb](https://github.com/mongodb/mongo-rust-driver) to permit the latest version.
- [Release notes](https://github.com/mongodb/mongo-rust-driver/releases)
- [Commits](mongodb/mongo-rust-driver@v2.7.0...v3.0.1)

---
updated-dependencies:
- dependency-name: mongodb
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot deleted the dependabot/cargo/mongodb-3.0.1 branch September 2, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants