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

Session decorators don't use the modules config for key names #155

Open
Way opened this issue Jul 9, 2021 · 0 comments
Open

Session decorators don't use the modules config for key names #155

Way opened this issue Jul 9, 2021 · 0 comments

Comments

@Way
Copy link

Way commented Jul 9, 2021

Versions (please complete the following information):

  • NgxWebstorage: 8.0.0
  • Angular: 12.1.1

Describe the bug
Decorators do not always take into account the module configuration in the forRoot.

I configured the NgxWebstorageModule like this:

NgxWebstorageModule.forRoot({
  prefix: 'app',
  separator: '.'
})

All values that I set via the services are correctly set as app.[key]. But with the decorators it happens that a value is saved as ngx-webstorage|[key]. So it seems that decorators use the default configuration of the module.
I suspect a race condition but how can I avoid it?
The NgxWebstorageModule.forRoot() is loaded directly into the CoreModule of my app as the first module.

To Reproduce
Unfortunately, I cannot simply reproduce the problem myself in a simple example, since it does not occur here.

Has anyone ever noticed the problem?

Expected behavior
I expect that all values are set either by service or by decorator should use the given configuration to create their keys.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
The application in which it occurs has a bunch of lazy-loaded modules, uses a CoreModule for all forRoot modules that only need to be instantiated once in the AppModule and a SharedModule that is shared with the lazy modules.
Even when I put the NgxWebstorageModule.forRoot() in the app.module at the very beginning of the imports, the issue stays the same.

@Way Way changed the title Session decorators don't Session decorators don't use modules config for key names Jul 9, 2021
@Way Way changed the title Session decorators don't use modules config for key names Session decorators don't use the modules config for key names Jul 9, 2021
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

1 participant