this endpoint was more about checking the validity of the token, so Unauthorized didn't seemed appropriate to me.
2019-01-22 02209, 2019
alastairp
oh, interesting
2019-01-22 02217, 2019
iliekcomputers
the user is authorized to send an invalid token, we just check it against the db and return that it is invalid.
2019-01-22 02259, 2019
alastairp
OK, I didn't notice that it was on that endponint
2019-01-22 02232, 2019
alastairp
tbh, that endpoint feels a bit weird to me anyway... I'm not sure why people can't just use any endpoint and check for an unathorized response
2019-01-22 02241, 2019
alastairp
but you're right, the behaviour of this one is a bit more subtle
2019-01-22 02257, 2019
alastairp
(I've never seen any other authenticated api (e.g. with oauth) have an endpoint specifically to check that the keys are correct)
2019-01-22 02222, 2019
iliekcomputers
there was a dev of an app who wanted that endpoint. to use the other endpoints (just to check that the token is valid) they'd have to create fake data etc. (https://tickets.metabrainz.org/browse/LB-377)
2019-01-22 02222, 2019
BrainzBot
LB-377: Add user token query
2019-01-22 02244, 2019
alastairp
right, so we have no endpoint which doesn't create data? that's a pity
2019-01-22 02202, 2019
alastairp
ohwell, no problem then
2019-01-22 02249, 2019
alastairp
that documentation could be made a bit clearer in this case
2019-01-22 02204, 2019
alastairp
it'd be nice to not have to parse a string to get the valid/invalid
2019-01-22 02228, 2019
alastairp
e.g. it could return {"status": "invalid", "message": "No such token found"}, or similar
2019-01-22 02224, 2019
alastairp
because there's a question of how someone uses this response to verify their token - with the current response do they check against the exact string? What if we change the string in the future? (should we have a comment saying to never change this, because it'll break external code?)
2019-01-22 02240, 2019
iliekcomputers
right, good point.
2019-01-22 02256, 2019
alastairp
this is a reason why status codes might be nicer - we could potentially change the message and the way that the end-client checks would stay the same
2019-01-22 02229, 2019
alastairp
in any case, the documentation should include _how_ the end client can tell that the token is valid/invalid
2019-01-22 02230, 2019
alastairp
OK, cool
2019-01-22 02231, 2019
alastairp
next!
2019-01-22 02200, 2019
alastairp
https://github.com/metabrainz/listenbrainz-server… I'm not sure about this change either - There likely isn't much efficiency difference in using uuid or varchar types, and it means that we turn an implementation detail into something enforced by the database. Is there a chance that some time we might change this token to something that isn't a uuid?
2019-01-22 02211, 2019
alastairp
this is similar: https://github.com/metabrainz/listenbrainz-server…, I'm not convinced that is is a useful change - it means we lock ourselves into a specific format for this token, which may not always be the case
2019-01-22 02245, 2019
ruaok has coffee
2019-01-22 02246, 2019
alastairp
sure, we may never change the format, but changing the type to uuid doesn't bring us any benefits that I can see
2019-01-22 02247, 2019
ruaok
mooooin!
2019-01-22 02255, 2019
yvanzo
mo''in'
2019-01-22 02208, 2019
zas
moooin
2019-01-22 02227, 2019
ruaok
LB hack day is here! I'm excited.
2019-01-22 02240, 2019
iliekcomputers
alastairp: I am not sure. it makes stuff a little cleaner. and it makes the schema change easier because of the default values we can set.
2019-01-22 02246, 2019
ruaok
and my mail queue didn't asplode overnight.
2019-01-22 02206, 2019
alastairp
iliekcomputers: which pull request specifcially?
2019-01-22 02212, 2019
iliekcomputers
the first one.
2019-01-22 02248, 2019
zas
outsidecontext: we had very few bug reports for Picard 2.1.0, what do you think about releasing 2.1.1 with current fixes ? Also how can we improve things regarding PICARD-1447 ?
the fact that we were storing uuids in a string column bugged me, but the argument for future use does make sense.
2019-01-22 02233, 2019
alastairp
I'm not sure if that's strictly true - can always do some additional code in the sql update script to add a column, set a value, and then change its default
2019-01-22 02205, 2019
alastairp
efficiency-wise, there's not a lot of difference in storing a string or uuid type in postgres
2019-01-22 02207, 2019
ruaok
Mr_Monkey: have you read through the doc yet. I made lots of changes after you called for bed time
2019-01-22 02231, 2019
alastairp
there's no reason why that column couldn't start as the same value as musicbrainz_row_id
> This way you are free to change the user’s alternative id to a new randomly generated value when the user changes their password, which would ensure their old authentication sessions will cease to be valid
2019-01-22 02227, 2019
alastairp
keep in mind that as the code is now, we'll log everyone out when we deploy
2019-01-22 02247, 2019
alastairp
(does this actually matter? if we already log out on browser-close anyway, it's not like we have long sessions)
2019-01-22 02251, 2019
alastairp
anyway, it's not going to be the end of the world if we make these changes - they just struck me as unnecessary when I saw them
2019-01-22 02200, 2019
iliekcomputers
yeah, that sounds good to me. put musicbrainz_row_id's inside the column initially.
2019-01-22 02202, 2019
alastairp
it's not going to break anything if we keep them as-is
2019-01-22 02209, 2019
Mr_Monkey
ruaok: got coffee, will read now
2019-01-22 02254, 2019
iliekcomputers
I'd prefer to close the remember me PR soon. it's been there for a long time.
2019-01-22 02219, 2019
iliekcomputers
do you think moving forward with it for now is okay? (considering we'd have to request more changes undoing the last request of changes... (oops))
2019-01-22 02237, 2019
iliekcomputers
we can open a ticket for changing the column type.
2019-01-22 02252, 2019
alastairp
I was going to make a comment about the use of the API, in response to the question
2019-01-22 02210, 2019
alastairp
I've got lots of things on the first half of this week, but I'll see what I can do
2019-01-22 02247, 2019
alastairp
the thing about the column type, is we'd have to make the change before releasing it - otherwise the use of musicbrainz_row_id is useless (since any time you change the id, you'll log out users)
I've been waiting for things to calm down in the channel before taking over.
2019-01-22 02235, 2019
ruaok
but, head over to the doc and read what I've updated last night.
2019-01-22 02244, 2019
ruaok
there are loads of open questions.
2019-01-22 02204, 2019
D4RK-PH0ENiX has quit
2019-01-22 02206, 2019
alastairp
ruaok: I'm basically done, I think
2019-01-22 02216, 2019
ruaok
alastairp: ok. thanks!
2019-01-22 02217, 2019
alastairp
let me just read what iliekcomputers linked
2019-01-22 02257, 2019
madmouser1_ is now known as madmouser1
2019-01-22 02216, 2019
alastairp
iliekcomputers: right - I implemented that. At the time, I needed somthing to fill the column with, so I used a uuid. think of it as "a string that happens to be filled with a uuid", rather than "a uuid in a string column". If I'm honest, I was never happy with using uuid to fill that column, so I guess it's a bit like the opposite of that discussion
2019-01-22 02235, 2019
alastairp
again, no strong feelings either way, but my preference is to keep it as a string
2019-01-22 02252, 2019
alastairp
and on that note, I have other things that have to be finished today. enjoy the hackday!
2019-01-22 02220, 2019
iliekcomputers
thanks for the feedback alastairp!
2019-01-22 02223, 2019
ruaok
Mr_Monkey: iliekcomputers : let me know when you've read the doc, so we can go over it from the top. make sure we're on the same page.
2019-01-22 02244, 2019
Mr_Monkey
Yep, all read for me ruaok
2019-01-22 02246, 2019
iliekcomputers
ready.
2019-01-22 02256, 2019
ruaok
aight.
2019-01-22 02201, 2019
Gazooo has quit
2019-01-22 02220, 2019
ruaok
from a 20,000ft perspective, I'm suggesting that we add a simple web sockets layer that pushed new listens to the client.
2019-01-22 02241, 2019
ruaok
the new listens that get pushed are picked from the firehose of listens based on a follow-list sent to the server.
2019-01-22 02207, 2019
ruaok
the client can then make intelligent decisions on what listens to play for a user.
2019-01-22 02228, 2019
ruaok
the goal is to make the listens page dynamic and to allow the user to explore the listens of another users.
2019-01-22 02237, 2019
ruaok
either passively, or following users actively.
2019-01-22 02244, 2019
ruaok
decent summary so far?
2019-01-22 02246, 2019
Gazooo joined the channel
2019-01-22 02252, 2019
Mr_Monkey
Yep
2019-01-22 02257, 2019
iliekcomputers
hmm.
2019-01-22 02221, 2019
ruaok
whatchat got, iliekcomputers ?
2019-01-22 02203, 2019
iliekcomputers
where do you choose which listens are to be sent to which connection?
2019-01-22 02210, 2019
D4RK-PH0ENiX joined the channel
2019-01-22 02220, 2019
iliekcomputers
in a flask socketio endpoint?
2019-01-22 02247, 2019
ruaok
yes.
2019-01-22 02251, 2019
iliekcomputers
if so, where do we get the listens from? Inside influx?
2019-01-22 02255, 2019
ruaok
so, I envision that we need a new container.
2019-01-22 02211, 2019
ruaok
that container is running at hetzner and follows a structure very similar to a bigquery-writer.
2019-01-22 02222, 2019
ruaok
it consumes the de-duped stream of listens.
2019-01-22 02240, 2019
ruaok
it keeps track of user -> follow list pairs in redis.
2019-01-22 02222, 2019
ruaok
so, when a listen comes is from a user, the inverted list of all the users who are following that user is fetched from redis (or kept in ram) and listens are sent to those websockets.
2019-01-22 02200, 2019
iliekcomputers
oh.
2019-01-22 02203, 2019
ruaok
we'd still need to watch redis for listening_now listens.
2019-01-22 02204, 2019
iliekcomputers
ok, cool.
2019-01-22 02208, 2019
ruaok
those are not put into the pipeline.
2019-01-22 02202, 2019
Mr_Monkey
I'll need some clarification on that, ruaok, but it'll be better in person.
2019-01-22 02212, 2019
ruaok
ok.
2019-01-22 02227, 2019
ruaok
how are we on general overview?
2019-01-22 02258, 2019
ruaok
next, let pick off point 3 near the top.
2019-01-22 02224, 2019
ruaok
If a user plays down the page, eventually the user will run out of listens.
2019-01-22 02228, 2019
ruaok
what do we do then?
2019-01-22 02236, 2019
iliekcomputers
load more listens from the next page.
2019-01-22 02239, 2019
iliekcomputers
?
2019-01-22 02242, 2019
Mr_Monkey
^
2019-01-22 02243, 2019
ruaok
1) dynamically load more from the API
2019-01-22 02255, 2019
ruaok
2) reload the page to the next page.
2019-01-22 02209, 2019
ruaok
2 might be harder, since we need to preserve state between reloads.