Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 20 2020 16:35

    DylanPiercey on master

    Update request.md chore: short… (compare)

  • Dec 20 2020 16:34

    DylanPiercey on master

    Update response.md chore: upda… (compare)

  • Dec 20 2020 16:32

    DylanPiercey on master

    Update request.md chore: updat… (compare)

  • Dec 20 2020 16:31

    DylanPiercey on master

    Update README.md chore: update… (compare)

  • Feb 28 2018 04:17

    DylanPiercey on v7.0.4

    (compare)

  • Feb 28 2018 04:17

    DylanPiercey on master

    Improve typings. 7.0.4 (compare)

  • Feb 27 2018 07:44

    DylanPiercey on v7.0.3

    (compare)

  • Feb 27 2018 07:44

    DylanPiercey on master

    Add type definitions for tls op… 7.0.3 (compare)

  • Feb 27 2018 05:51

    DylanPiercey on platform-agnostic

    (compare)

  • Feb 27 2018 05:51

    DylanPiercey on file-size

    (compare)

  • Feb 27 2018 05:51

    DylanPiercey on add-code-of-conduct-1

    (compare)

  • Nov 20 2017 03:11

    DylanPiercey on v7.0.2

    (compare)

  • Nov 20 2017 03:11

    DylanPiercey on master

    Update size in readme 7.0.2 (compare)

  • Nov 19 2017 02:31

    DylanPiercey on v7.0.1

    (compare)

  • Nov 19 2017 02:31

    DylanPiercey on master

    * Update example links in readm… 7.0.1 (compare)

  • Nov 18 2017 04:31

    DylanPiercey on master

    * Update changelog. * Release 7… 7.0.0 (compare)

  • Nov 18 2017 04:31

    DylanPiercey on v7.0.0

    (compare)

  • Nov 18 2017 04:00

    DylanPiercey on v7.0.0-rc.12

    (compare)

  • Nov 18 2017 04:00

    DylanPiercey on master

    Remove default of 404 on status… 7.0.0-rc.12 (compare)

  • Nov 12 2017 18:53

    DylanPiercey on master

    * Organize types in namespace. … 7.0.0-rc.11 (compare)

Dylan Piercey
@DylanPiercey
Want to post a code snippet and I’ll see if I can figure it out when I get some time later today?
Andrew Smith
@silentworks
@DylanPiercey are you on Glitch? If yes can I PM you a link so you can go to the code directly
Dylan Piercey
@DylanPiercey
@silentworks I haven’t heard of glitch but if you pm me a link I’ll check it out.
Hafiz Suara
@hafbau
Hi @DylanPiercey could you please point me to an example where Rill has been used with websockets?
Hafiz Suara
@hafbau
Oh, I figured it out!
Dylan Piercey
@DylanPiercey
Glad to hear! Feel free to reach out if you need any further help.
Dylan Piercey
@DylanPiercey
Rill 7.0.0 has been released! Please notify me of any issues and I'll try to resolve ASAP. Should be a non-breaking change for most people though.
Dylan Piercey
@DylanPiercey
@silentworks you may be interested In the new isomorphic svelte todo-mvc app. Sorry for being late, have been busy lately!
Andrew Smith
@silentworks
Thanks @DylanPiercey
Andrew Smith
@silentworks
Is Passport compatible with rill?
Dylan Piercey
@DylanPiercey
@silentworks it could be compatible (if you wanted to make it work you could look at a koa adapter and a Rill adapter would be very similar.). I personally ran into issues with it (not integration with Rill) so liked to manually setup my oauth. I could revisit making a middleware for it though.
Evan Hahn
@EvanHahn
Hi! I maintain Helmet and I found @rill/helmet. Let me know if I can do anything to help there.
Some of the documentation looked a little out of data to me.
Dylan Piercey
@DylanPiercey
@EvanHahn I’ve been trying to keep on top of it, if things are a bit out of date I can look at this later today. If you wouldn’t mind making a PR that would be great though.
Evan Hahn
@EvanHahn
Will do! Is there any documentation other than what's at https://github.com/rill-js/helmet?
Dylan Piercey
@DylanPiercey
Nope, just whats in the readme.
Evan Hahn
@EvanHahn
Made a few PRs!
Evan Hahn
@EvanHahn
I'm gonna hop off of Gitter now but feel free to shoot me an email at me@evanhahn.com or we can discuss things on the PRs.
:wave:
Dylan Piercey
@DylanPiercey
Awesome, thanks for doing that! Everything looks fine, i’ll create a release later today :).
Lon Ilesanmi
@lon-io
Hi @DylanPiercey, I discovered that return res.redirect(...) does not work when called within within a call to setTimeout
Is there a way to go around this?
Lon Ilesanmi
@lon-io
Nvm @DylanPiercey I was able to work around it by following this:
https://stackoverflow.com/a/24929146/4931825
Dylan Piercey
@DylanPiercey
Nice, feel free to post a code snippet and I can help you out further if needed.
Lon Ilesanmi
@lon-io
Sure, something like this:
return new Promise((resolve) => {
            setTimeout(() => {
                return resolve(res.redirect('/'));
            }, 3000);
        });
Efrain Diaz
@eudp
Hello @DylanPiercey . I was wondering if it's possible to enable CORS in Rill? If possible how I can do that? I have expend some time trying to figure out where I can update the headers to make this possible. Thanks in advance!
Efrain Diaz
@eudp
thanks! @DylanPiercey
Dylan Piercey
@DylanPiercey
Happy to help :smile:
Mike MacDonald
@mikemacdonald123

Hi @DylanPiercey we are having some issues with rill-session when running the app on chrome. Basically, when you refresh the page or open a new tab the session gets lost and logs the user out. This is not happening on firefox, safari, or any other browser. Can you help?

We managed to get some logs while refreshing the browser while logged in on /some-route

chrome:

@rill/session:28 - req.pathname: /some-route
@rill/session:68 - rill_auth.value: undefined
  <-- GET /some-route
  --> GET /some-route 302 6ms -
@rill/session:28 - req.pathname: /logout
@rill/session:68 - rill_auth.value: undefined
  <-- GET /logout?redirect=/some-route
  --> GET /logout?redirect=/some-route 302 8ms -
@rill/session:28 - req.pathname: /login
@rill/session:68 - rill_auth.value: undefined
  <-- GET /login?redirect=/some-route
  --> GET /login?redirect=/some-route 200 16ms -
user disconnected
@rill/session:28 - req.pathname: /__rill_session__
@rill/session:40 - reading cache
a user connected

firefox:

@rill/session:28 - req.pathname: /__rill_session__
@rill/session:46 - setting cache
user disconnected
@rill/session:28 - req.pathname: /some-route
@rill/session:68 - rill_auth.value: {
  _id: '6015878d...',
  token: 'eyJ0eX...'
}
  <-- GET /some-route
  --> GET /some-route 200 213ms -
@rill/session:28 - req.pathname: /__rill_session__
@rill/session:40 - reading cache
a user connected
Mike MacDonald
@mikemacdonald123
Correction* it is also happening on safari
Dylan Piercey
@DylanPiercey
@mikemacdonald123 there are three possible issues:
  1. @rill/session used a "beforeunload" handler to persist session data which browsers have gradually stopped supporting. I just released a new major version @rill/session@11.0.0 which switches to use more modern apis, you should try that.
  2. Could also be that a middleware in your application is causing a redirect or something is preventing the @rill/session middleware from executing.
  3. Possible that you are clearing cookies some way, and or viewing the page with cookies disabled.
Roberto Barreto
@robertobarretog
Hi @DylanPiercey we tried the new version @rill/session@11.0.0 and the user gets logged out when reloading on Chrome. On Firefox the user also gets logged out and the following error is thrown:
Error: bad content-type header, unknown content-type: text/plain;charset=UTF-8
    at IncomingForm._parseContentType (node_modules/formidable/lib/incoming_form.js:293:15)
    at IncomingForm.writeHeaders (node_modules/formidable/lib/incoming_form.js:144:8)
    at IncomingForm.parse (node_modules/formidable/lib/incoming_form.js:112:8)
    at node_modules/@rill/body/server/index.js:82:8
    at new Promise (node_modules/core-js/modules/es6.promise.js:177:7)
    at parse (node_modules/@rill/body/server/index.js:61:10)
    at parseBody (node_modules/@rill/body/server/index.js:39:12)
    at dispatch (node_modules/@rill/chain/src/index.ts:46:38)
    at node_modules/@rill/chain/src/index.ts:46:52
    at node_modules/@rill/static/server/index.js:29:16
    at run (node_modules/core-js/modules/es6.promise.js:75:22)
    at node_modules/core-js/modules/es6.promise.js:92:30
    at flush (node_modules/core-js/modules/_microtask.js:18:9)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
Dylan Piercey
@DylanPiercey
@robertobarretog I just published 11.0.1 which will fix that!
I think there's one other issue. It's related to performance and shouldn't have an end user impact. Going to see what I can do.
Dylan Piercey
@DylanPiercey
Alright, 11.0.2 contains the perf fix, and seems to work in all browsers I've tested.
Roberto Barreto
@robertobarretog
@DylanPiercey just tried 11.0.2 and it's working again on firefox but not on chrome (no errors though). I also checked and the rill_session cookie is there on both browsers. I looked in the network tab of dev tools while reloading to try to find any difference and on firefox there is a POST followed by a GET to __rill_session__, on chrome there is an incomplete request and then GET to __rill_session__. Do you know what could be happening there? Thanks for your response!
Dylan Piercey
@DylanPiercey
@robertobarretog it's hard to say, are you still seeing any errors in the chrome request (server or browser)?
Roberto Barreto
@robertobarretog
@DylanPiercey when I hover over the request on chrome it says The request status cannot be shown here because the page that issued it unloaded while the request was in flight.
Roberto Barreto
@robertobarretog
No errors on the server or browser
Dylan Piercey
@DylanPiercey
@robertobarretog looks like there's still a race condition with using sendBeacon. I'm somewhat out of ideas, ultimately the goal of this module is to persist the session with the server once the browser exits but I think reliable ways to do that (at least before the next navigation) have been disabled by browsers. So I just got out another patch of @rill/session which instead persists the session at the end of each client side navigation. It's not quite as efficient, but should work fine.
Roberto Barreto
@robertobarretog
Thanks! @DylanPiercey I tried the latest version and the sessions are working on Chrome, Firefox and Safari. I'm only seeing an error on Safari but it seems to be because the @rill/loader cache is too large in our app, the session still works though. Beacon API cannot load http://localhost:3002/__rill_session__. Reached maximum amount of queued data of 64Kb for keepalive requests.
Roberto Barreto
@robertobarretog
Hey @DylanPiercey sorry to bother you again, after testing the latest @rill/session we are experiencing an issue on safari which is happening seemingly at random: sometimes when entering the app or reloading the browser the app doesn't respond to user interaction, as if it was a cached view only, in the browser console only connected to the server is logged. Reloading the app a few times can get it to work and in that case the browser console shows:
connected to the server
<-- GET /settings
--> GET /settings 200 7,947ms
Dylan Piercey
@DylanPiercey
@robertobarretog I guess my change to sendBeacon is not reliable enough for this. With the other changes I made it's fine for me to switch back to regular xhr and so I just got out a release which does that. Hopefully that should resolve your issue.
@rill/session@11.0.4
Roberto Barreto
@robertobarretog
@DylanPiercey I just tried 11.0.4 and unfortunately the issue is still present on safari, I opened / reloaded the app while watching the network requests and safari just doesn't fire the xhr request sometimes
Dylan Piercey
@DylanPiercey
Hmm.. Well I'm stumped on that. I imagine it must have something to do with the payload size or something like that as I'm not able to reproduce.
Mike MacDonald
@mikemacdonald123
@DylanPiercey just sent you an email with a recording of us reproducing the issue.
Dylan Piercey
@DylanPiercey
@mikemacdonald123 @robertobarretog I had another theory and pushed out a change @rill/session@11.0.5, if you could give that a try.
Roberto Barreto
@robertobarretog
@DylanPiercey I just tried 11.0.5 and it works like a charm! thanks for your help on this, really appreciate it!
Dylan Piercey
@DylanPiercey
:tada: