<Thomas>
A browser sends Origin headers with the request etc.
<RockyTV>
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
<Thomas>
Ohh, I have an idea
<Thomas>
You need to set a bool in the sdb config to activate CORS
<Thomas>
disable-same-origin: true
<Thomas>
It seems that this is set to false
<RockyTV>
it worked but now it sends a 403 with GET
<RockyTV>
game_short, gameversion and gameversion_id are empty
<RockyTV>
shouldn't those be defined according to game?
<Thomas>
Yes and no
<Thomas>
Ther will always be unfilled parameters
<Thomas>
*there
<Thomas>
Because of the amount of recursion is allowed
<Thomas>
In the end, almost all objects are somehow self-referencing
<Thomas>
so there has to be a cut somewhere
<RockyTV>
so why not remove game_short from the mod object then?
<Thomas>
Wait, thats something different
<Thomas>
game_short is not in the mod object
<Thomas>
it is added by a plugin
<Thomas>
Ah, yeah, but in the end it is the same issue
<Thomas>
The transformation does m["game_short"] = mod.Game.Short
<Thomas>
and mod.Game isn't initialized
<RockyTV>
why is mod.Game not init?
<Thomas>
recursion level
<Thomas>
for the lists it is entirely disabled
<RockyTV>
I don't understand
<Thomas>
if you open /api/mods/kerbal-space-program/1
<Thomas>
you will see it
<Thomas>
Well
<Thomas>
If the backend is asked to display all mods
<Thomas>
it wont bother fetching their relations
<Thomas>
because that takes too much time
<Thomas>
it fetches all the data from the table and ignores relations to other objects
<RockyTV>
can't we remove those empty fields?
<Thomas>
We could but I would like to keep them
<Thomas>
because if we keep them we can continue to pass the object to the go json encoder
<RockyTV>
what's the point of keeping empty objects?
<Thomas>
when we remove them we have to process the objects ourselves or do other yanky stuff
<Thomas>
it is simpler, and it doesnt hurt
<Thomas>
it is confusing ok, but the backend data isnt meant to be read by end users anyway
<RockyTV>
I'm pretty sure when sdb is on prod some people will question why some fields are empty
<RockyTV>
some developers, that is
<Thomas>
And we can explain it to developers
<Thomas>
I mean, sure, we can change it, but to me it would be more confusing to have different fields when calling different routes
<RockyTV>
how much performance do we end up trading for displaying the data?
<Thomas>
Depends how deep we want to go
<Thomas>
Every mod fetches 7 other objects
<Thomas>
so if we go to level 1, we end up with 7x more queries being made
<RockyTV>
its weird
<RockyTV>
because the frontend will "suffer" from it
<RockyTV>
instead of getting the game short directly from a list of mods, it'll have to query the backend to get the game short for the specified game id
<RockyTV>
btw, is the /api/mods/random going to be a plugin or can it be implemented directly in sdb?
<Thomas>
RockyTV: Well, doing one additional request for one mod is cheaper than doing 7 times more queries for probably hundreds of mods
<Thomas>
RockyTV: And about the random: I would say plugin
<Thomas>
But it wouldn't be a problem for me to implement it in sdb
<RockyTV>
I added it as an exception to /api/mods/:gameshort
<RockyTV>
because iris was complaining about registering a route in /api/mods/random
<Thomas>
Ah yeah, thats a problem
<Thomas>
Could you add the same exception to /api/mods/:gameshort/:modid ? Could be useful for game specific randomness
<RockyTV>
okay
Azander has quit [Ping timeout: 200 seconds]
Azander has joined #spacedock
<SpaceDock>
[SpaceDock-Backend] StollD pushed 1 new commit to master: https://git.io/v74jf
<SpaceDock>
SpaceDock-Backend/master 701cc43 Dorian Stoll: Fix some attributes
<Qboid>
Starting build #63 for job SpaceDock-Backend (previous build: FAILURE -- last SUCCESS #61 1 day 1 hr ago)
<RockyTV>
the powershell script for installing the plugins is borken
<RockyTV>
I think
<Thomas>
Works perfectly for me
<RockyTV>
might be because my glide ins't in gopath/bin
<Thomas>
RockyTV: Yeah. I didn't want to assume that glide is in PATH
<Thomas>
Or in the same directory
<RockyTV>
you do know that gopath/bin (which gets set to lgobin) needs to be on path, right?
<Thomas>
Yes, but since gopath/bin is a standarized location in the go ecosystem, it is better to demand adding that to the path that some random location
<Thomas>
and everyone could do the same as the plugin script: use the full (or relative) path