Skip to content
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

Dream.flash_message should provide debug mode #90

Closed
thangngoc89 opened this issue Jul 2, 2021 · 4 comments
Closed

Dream.flash_message should provide debug mode #90

thangngoc89 opened this issue Jul 2, 2021 · 4 comments
Milestone

Comments

@thangngoc89
Copy link
Contributor

From my experience adding flash message, it could be extremely frustrating to debug why flash messages aren't rendered at all.

I wrote this little middleware to help with debugging but this should probably be added to Dream.flash_message directly

type flash = (string * string) list [@@deriving show]

let debug_flash inner_handler request =
  let%lwt response = inner_handler request in
  let local = Dream.get_flash request in
  Dream.log "flash messages: %s" (show_flash local) ;
  Lwt.return response
@aantron
Copy link
Owner

aantron commented Jul 2, 2021

I guess there should probably be a dream.flash log source. Dream also needs a neat way to set the log level per-source, and then flash messages need documentation about the existence of verbose logging on dream.flash at level debug. Would that do?

@aantron
Copy link
Owner

aantron commented Jul 2, 2021

A good place for such documentation might be the not-yet-integrated flash message example, which also needs a README.

@aantron aantron added this to the alpha3 milestone Jul 3, 2021
@aantron
Copy link
Owner

aantron commented Jul 19, 2021

The flash message middleware should probably also warn if the whole encrypted cookie is more than 4096 bytes long.

@jsthomas
Copy link
Contributor

I'm interested in working on this issue.

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

No branches or pull requests

3 participants