-
Notifications
You must be signed in to change notification settings - Fork 29
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
Why is Breadcrumbs a Singleton? #12
Comments
Hello Stuart. I will make tests trying to reproduce points that you wrote at this issue. I will not reply all questions here because I wrote breadcrumbs have many years and don't remember everything about code now, but about singleton, as I remember, I used a singleton with idea of have one breadcrumbs instance over all request, and never experienced 'cross breadcrumbs', but now sounds weird and I will take a better look :). Thx! |
Hello Felipe -- Thanks for the quick reply! I appreciate that you made this project available on github, and I noticed that it has been a while since you made changes to it. So don't worry too much about it. Mainly I just wanted to make sure I wasn't missing something obvious on my end. Cheers! --Stuart |
I came here investigating this same issue. I've seen behavior that I'm pretty sure is tied to the use of Singleton, although it's hard to reproduce. We are running Django via Apache/wsgi, and if multiple users are making requests at the same time, one of them may get nothing while the other gets a concatenation of both sets of breadcrumbs. I noticed there is a fork at https://github.com/alepane21/django-breadcrumbs which appears to do nothing but remove the Singleton behavior -- I don't know the author or how it's been tested, but it seems like a simple enough change. |
Wil check that this weekend. Someone have a idea how I can reproduce this kind of test in a unit or Felipe 'chronos' Prenholato. 2014-06-17 20:39 GMT-03:00 adam-iris [email protected]:
|
This issue makes this library impossible to use with django's CachedTemplateLoader: https://docs.djangoproject.com/en/1.8/ref/templates/api/#django.template.loaders.cached.Loader
|
I notice Breadcrumbs is a singleton. Won't this give each user on the system the same breadcrumb trail? That is not desirable, is it?
Also, why does the middleware's process_request call the _clean method? Doesn't that dump all the existing crumbs, thereby leaving only the single crumb added by the view, thereby defeating the purpose of breadcrumbs?
Am I missing something about how this application is intended to be used?
Thanks,
--Stuart
The text was updated successfully, but these errors were encountered: