GithubHelp home page GithubHelp logo

Comments (11)

maxcountryman avatar maxcountryman commented on May 29, 2024 2

As I mentioned, axum needs to be updated. You have 0.6.

from tower-sessions.

maxcountryman avatar maxcountryman commented on May 29, 2024 1

It's hard to say exactly what state your build was in when it seemed to not be working.

Regardless, the flag is not needed and as I mentioned not intended to be used directly unless you're authoring a store that requires the deletion task.

from tower-sessions.

maxcountryman avatar maxcountryman commented on May 29, 2024

Your dependencies are not updated such that the types match.

Without seeing your code, I can guess it's probably axum or http: both need to be updated. L

You will also need to ensure the deletion trait is in scope.

from tower-sessions.

HosMercury avatar HosMercury commented on May 29, 2024
[dependencies]
anyhow = "1.0.75"
argon2 = "0.5.2"
askama = { version = "0.12.1", features = ["serde_json"] }
axum = { version = "0.6.20", features = ["macros"] }
dotenvy = "0.15.7"
dry-run = "0.0.0"
lazy_static = "1.4.0"
once_cell = "1.18.0"
regex = "1.10.2"
secrecy = { version = "0.8.0", features = ["serde"] }
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
sqlx = { version = "0.7.2", features = ["postgres", "runtime-tokio-rustls","time","uuid"] }
time = { version = "0.3.30", features = ["serde","macros","formatting"] }
tokio = { version = "1.33.0", features = ["full"] }
tower = "0.4.13"
tower-http = { version = "0.5.0", features = ["fs"] }
tower-sessions = { version = "0.7.0", features = ["postgres-store"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.17"
uuid = { version = "1.5.0", features = ["v4", "fast-rng", "macro-diagnostics", "serde"] }
validator = { version = "0.16.1", features = ["derive"] }

from tower-sessions.

HosMercury avatar HosMercury commented on May 29, 2024

there is something missing

from tower-sessions.

HosMercury avatar HosMercury commented on May 29, 2024

still has this
error[E0599]: no method namedcontinuously_delete_expiredfound for structPostgresStorein the current scope --> src/lib.rs:85:14 | 83 | / session_store 84 | | .clone() 85 | | .continuously_delete_expired(tokio::time::Duration::from... | | -^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found inPostgresStore| |_____________| |

from tower-sessions.

maxcountryman avatar maxcountryman commented on May 29, 2024

As I said, you need to bring the trait in scope.

Please make sure you follow the examples and give us complete, working examples so we can help you.

from tower-sessions.

HosMercury avatar HosMercury commented on May 29, 2024

which trait ?

from tower-sessions.

rogusdev avatar rogusdev commented on May 29, 2024

I also encountered this when upgrading from 0.4. I already had this working with use tower_sessions::session_store::ExpiredDeletion however it required the feature deletion-task which previously was on tower-sessions but was not there anymore, nor moved to tower-sessions-sqlx-store so I had to do some digging.

It seems that the missing instruction, which I don't see in any of the docs or git repos, is to add to my cargo toml:

tower-sessions-core = { version = "0.10.0", features = ["deletion-task"] }

Is this mentioned somewhere that I am missing? There are no complete examples that have this referenced, e.g.
https://github.com/maxcountryman/tower-sessions-stores/blob/main/sqlx-store/examples/postgres.rs

I do see this here -- but I only found it after knowing what to look for, and it was not obvious that this was related:
https://github.com/maxcountryman/tower-sessions-stores/blob/3d60f41bbca0728b95cffeea5922e31704c036a2/sqlx-store/Cargo.toml#L26

An ideal location from my perspective would be to mention this in the rdoc that covers adding this functionality:
https://docs.rs/tower-sessions/latest/tower_sessions/#session-expiry-management

Thanks for the great project that clearly takes a lot of work to provide docs for, and the nontrivial improvements that have been made over its lifetime already. Hopefully this is an easy opportunity to clarify things somewhere.

from tower-sessions.

maxcountryman avatar maxcountryman commented on May 29, 2024

The deletion-task flag is enabled by tower-sessions-sqlx-store. What this means is you do not enable it directly anymore and generally speaking on store authors would enable this feature.

This is covered in the release notes where we migrate a SQLx example, including the Cargo.toml as an example. Generally speaking, the release notes and CHANGELOG are the places folks should be looking when updating breaking releases.

You should not enable deletion-task directly and if you find that you have to the most likely explanation is that you're using incompatible versions of tower-sessions and tower-sessions-sqlx-store.

from tower-sessions.

rogusdev avatar rogusdev commented on May 29, 2024

Thank you for your response! :) I very much want to get this sorted out.

I have this in my Cargo, I believe these are the relevant bits, and I believe these are the latest versions of all of these (per crates.io):

axum = { version = "0.7.4", features = ["multipart"] }
tower-sessions = "0.11.0"
tower-sessions-core = { version = "0.11.0", features = ["deletion-task"] }
tower-sessions-sqlx-store = { version = "0.11.0", features = ["postgres"] }
sqlx = { version = "0.7.4", features = ["runtime-tokio", "tls-rustls", "postgres"] }

My code absolutely did not compile until I added tower-sessions-core with deletion-task, and it was giving the same first error mentioned above.

That said, perhaps there was just something off somewhere else as well because now that it is all compiling fine, and given your insistence, I have removed that line from cargo and it still all compiles. So... I guess it is not needed indeed? Idk why, but that definitely was a thing that did not work until I did that.

from tower-sessions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.