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

[2302] put internal-session into DI system #2315

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

BobrImperator
Copy link
Collaborator

@BobrImperator BobrImperator commented Aug 13, 2021

closes #2302

  • remove setup-session-service initializer
  • modify tests to lookup registered entities instead of creating them in tests
  • conditionally lookup session-store in internal-session based on environment

@@ -147,19 +135,19 @@ describe('SessionService', () => {
it("is read from the session's content", function() {
session.set('some', 'data');

expect(sessionService.get('data')).to.eql({ some: 'data' });
expect(sessionService.get('data')).to.eql({ some: 'data', authenticated: {} });
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid change IMO since the internal-session initializes it's content to { authenticated: {} } while the test session proxy initialized an empty object instead.

@@ -808,11 +804,4 @@ describe('InternalSession', () => {
});
});
});

it('does not share the content object between multiple instances', function() {
Copy link
Collaborator Author

@BobrImperator BobrImperator Aug 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't make sense to me since there's only 1 session:main in the app anyway? Which is even more true with us only looking it up once in session service.

Copy link
Contributor

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Thank you!

Copy link
Collaborator

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good at first glance, but my knowledge of the ESA codebase is quite limited 😅

@snewcomer
Copy link
Contributor

Should we also take care of this deprecation or do that in a separate PR?

import { deprecate } from '@ember/application/deprecations';` has been deprecated, please update to `import { deprecate } from '@ember/debug';` [deprecation id: old-deprecate-method-paths]

@Turbo87
Copy link
Collaborator

Turbo87 commented Aug 24, 2021

@snewcomer seems unrelated to the DI stuff, so I'd suggest to do that in a dedicated PR

@BobrImperator BobrImperator merged commit a51315a into mainmatter:master Aug 26, 2021
@sly7-7
Copy link
Contributor

sly7-7 commented Aug 26, 2021

Thanks a lot @BobrImperator

@jordpo
Copy link

jordpo commented Aug 27, 2021

Thank you! Is there a new release for this?

@patrickberkeley
Copy link

@Turbo87 or @sdebarros would you mind cutting a release that includes this please?

@BobrImperator
Copy link
Collaborator Author

@patrickberkeley https://github.com/simplabs/ember-simple-auth/releases/tag/4.0.0

@patrickberkeley
Copy link

🎉 Thank you @BobrImperator !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implicit Injection Deprecated
6 participants