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

Refactor lib/middleware/ext/session.js #61

Closed
mwbrooks opened this issue May 27, 2014 · 7 comments
Closed

Refactor lib/middleware/ext/session.js #61

mwbrooks opened this issue May 27, 2014 · 7 comments

Comments

@mwbrooks
Copy link
Collaborator

This abstraction doesn't make sense. Let's rethink it..

@mwbrooks mwbrooks added this to the Backlog milestone Sep 16, 2015
@filmaj
Copy link
Collaborator

filmaj commented Apr 21, 2017

@mwbrooks care to dig deep into your May 27, 2014 memories to shed some light on what kind of refactor plans you had? :P

@filmaj
Copy link
Collaborator

filmaj commented Apr 24, 2017

Ping @surajpindoria @timkim in case y'all have more context as to what Mr. Brooks was thinking when he filed this....

@timkim
Copy link
Contributor

timkim commented Apr 24, 2017

This one is a little weird. It was originally used to figure out which platform/version of cordova a client needed. I think the re-think was figuring out a sane way of setting platforms and versions that were compatible. With content-sync, that part of session.js is no longer needed.

However, the module is still used to init some settings for each client. eg, if you look in https://github.com/phonegap/connect-phonegap/blob/master/lib/middleware/register.js#L5 you can see it setting some stuff.

@filmaj
Copy link
Collaborator

filmaj commented May 1, 2017

Based on the comments in that register module you linked to, it looks like it is only used to track cordova and device information within the session so that the proper cordova files are served. But, it sounds like content sync removes the need for this altogether.

Is this figure-out-which-cordova-to-serve the only thing we need to use sessions for? If so, perhaps we can remove the use of sessions altogether and simplify the module.

@timkim
Copy link
Contributor

timkim commented May 1, 2017

I think we still need the sessions object. It's used to store some more info used for the autoreload feature and content-sync. eg: https://github.com/phonegap/connect-phonegap/blob/master/lib/middleware/update.js#L44

However, the part where it figures out which cordova and what platform...probably won't need those.

@filmaj
Copy link
Collaborator

filmaj commented May 1, 2017

Right, makes sense.

May I suggest we close this issue down, as we don't really know how this ext/session module is to be refactored? Instead, all this stuff we've identified about session info we no longer need to track for serving particular cordova files, we drop that into #190 as part of what needs to be done for that issue?

@timkim
Copy link
Contributor

timkim commented May 1, 2017

SGTM.

@filmaj filmaj closed this as completed May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants