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

Bump koa dependencies #9

Closed
bitinn opened this issue Mar 31, 2015 · 6 comments
Closed

Bump koa dependencies #9

bitinn opened this issue Mar 31, 2015 · 6 comments

Comments

@bitinn
Copy link
Contributor

bitinn commented Mar 31, 2015

Is there a repo for grant-koa, the meta package locked koa-session to 3.0.0 and it throws errors when used with 3.1.0

Having meta package also lead to a few problems: we can't contribute easily or debug package (ie. temporally fork the repo and set package.json to use forked/grant)

@simov
Copy link
Owner

simov commented Mar 31, 2015

Currently there is no separate repositories for the meta packages as they contain only 4 files in them

.
├── index.js
├── LICENSE
├── package.json
└── README.md

I agree that separate repository will make it easier to point the dependency to your own fork.

As for breaking changes between 3.0.0 and 3.1.0 that's very unfortunate, because it's not a major release, but it happens.

@bitinn
Copy link
Contributor Author

bitinn commented Mar 31, 2015

Seems like koa-session specifically design 3.1.0 to make it backward compatibility, maybe he missed an edge case somewhere. I reverted to 3.0.0 for time being, will report back when I got time to checkout 3.1.0

@bitinn
Copy link
Contributor Author

bitinn commented Mar 31, 2015

OK, looks like this is also triggered by app.use ordering:

This works

app.use(session(app));
app.use(bodyParser());
app.use(mount(grant));

But not this

app.use(mount(grant));
app.use(session(app));
app.use(bodyParser());

Maybe update doc to avoid this mishap?

The error is likely due to this._ctx.sessionOptions being empty when cookie is set by 3.0 first.

 TypeError: Cannot set property 'maxAge' of undefined
      at new Session (/Users/teambegin/git/mai/node_modules/koa-session/index.js:152:59)
      at Object.session (/Users/teambegin/git/mai/node_modules/koa-session/index.js:64:16)

@simov
Copy link
Owner

simov commented Apr 1, 2015

Closing in favor of #10

@simov simov closed this as completed Apr 1, 2015
@simov
Copy link
Owner

simov commented May 17, 2015

@bitinn check out the latest changelog https://github.com/simov/grant/blob/master/CHANGELOG.md - it's not entirely related to Koa, but I'm sure you'll like it :)

@bitinn
Copy link
Contributor Author

bitinn commented May 17, 2015

@simov thx for the heads up, looks great! been using v3.2.0 in one of my project and so far so good, will upgrade to v3.3.0 soonish.

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

2 participants