0:12 AM
MRiddickW joined the channel
3:19 AM
MRiddickW has quit
5:26 AM
BenOckmore has quit
5:26 AM
BrainzGit has quit
5:26 AM
Leftmost has quit
5:26 AM
agatzk has quit
5:26 AM
kuno has quit
5:26 AM
Freso has quit
5:27 AM
BenOckmore joined the channel
5:27 AM
BrainzGit joined the channel
5:27 AM
CatQuest joined the channel
5:27 AM
agatzk joined the channel
5:27 AM
Leftmost joined the channel
5:27 AM
kuno joined the channel
5:27 AM
Freso joined the channel
5:37 AM
dgw has quit
5:37 AM
dgw joined the channel
5:50 AM
KassOtsimine has quit
5:51 AM
KassOtsimine joined the channel
8:28 AM
Shubh joined the channel
10:01 AM
Shubh
Hey monkey !
10:05 AM
monkey
Hi Shubh
10:06 AM
Saw your message about debugging with vscode. Any luck with that?
10:08 AM
Shubh
Nah , i ran that launch script given for for debugging in readme but that stupid error related to some import utils keep popping up
10:09 AM
btw i realized what was causing the website/container to crash !
10:09 AM
BB-635
10:09 AM
BrainzBot
10:10 AM
monkey
Ah nice!
10:10 AM
What's the culprit ?
10:10 AM
Shubh
i don't know if it cause the production build to go down as well but still i think its important to be fix !
10:11 AM
ah culprit was that god damn deleted enitty !
10:12 AM
monkey
Right, the crash was caused by deleting an already deleted entity. But what is the root cause?
10:13 AM
Shubh
handleDelete got that deleted entity it tries to delete all the relation of that enitty without any try error
10:14 AM
monkey
Ah I see.
10:14 AM
Shubh
i made a PR where i check its dataId
10:14 AM
monkey
Thank you!
10:15 AM
Shubh
will it cause production build to go down if same error occurs?
10:15 AM
monkey
It's abannk holiday here but I should have a bit of time today to look that and the vscode debugging
10:15 AM
Yes, it crashes the website too
10:16 AM
(But it comes back up automatically)
10:16 AM
Shubh
Ahh thats a relief
10:16 AM
monkey
But with your PR disallowinh deleting an already deleted entity, that shouldn't happen anymore
10:17 AM
And once both fixes are merged I'll deploy a new version of the website
10:19 AM
Shubh
are you able to debug BB in vscode?
10:20 AM
monkey
Will try today
10:20 AM
Haven't used it in a while
10:26 AM
Shubh
console logs sometimes don't make it into console! , have to rebuild the whole thing :'
11:56 AM
Shubh has quit
13:51 PM
Shubh joined the channel
13:52 PM
Hey monkey !
13:54 PM
monkey
👋
14:11 PM
Shubh
what would the right way to access data from database like details about some entity
14:12 PM
monkey
I would recommend installing this open-source database tool: DBeaver
14:13 PM
It's honestly the best tool I've used to access database data, schema diagrams, etc.
14:13 PM
Shubh
ahh in BB-site
14:13 PM
monkey
14:25 PM
Shubh
monkey i mean in BB-site using orm ..
14:25 PM
monkey
Sorry, I don't understand the question
14:26 PM
Shubh
I need to fetch information regarding entities ..
14:26 PM
monkey
14:26 PM
vishal5251
Hi
14:27 PM
monkey
Which is what we use to access the database in the website and API
14:27 PM
Hi vishal5251!
14:38 PM
vishal5251 joined the channel
14:38 PM
vishal5251
Hi Everyone!
14:38 PM
monkey
Hi vishal5251 !
14:41 PM
vishal5251
14:41 PM
hey monkey, my postgres is running in docker
14:42 PM
14:43 PM
monkey
vishal5251: That all looks right
14:45 PM
You might have to stop and restart bookbrainz-site for the configuration changes to take effect
14:45 PM
vishal5251
14:45 PM
monkey
Ah, well that's a step forward. Connection to database is working
14:45 PM
14:50 PM
vishal5251
while I was setting up, npm install shows error. So I deleted some scripts from package-json just to see that how this project gonna look.
14:52 PM
monkey
We've made a few changes last week regarding NPM install, so I would recommend to checkout the latest commit from the master repository, and try rebuilding the docker image (`docker-compose build bookbrainz-site`)
14:53 PM
If you still run into an issue we can try to figure it out together
14:55 PM
MRiddickW joined the channel
15:18 PM
Shubh
Hey monkey ..
15:18 PM
monkey
Yo
15:20 PM
Shubh
relationshipTypeId
15:20 PM
it is unique for all relation, i assume?
15:21 PM
monkey
I need some context :)
15:22 PM
But at a glance, relationshipType refers to one of the possible types of relationships (i.e. "author wrote work", etc;) rather than each relationship (i.e. "J.K. Rowling wrote Harry Potter")
15:23 PM
Shubh
Hmm so i need to get some data about entity so i was looking at code which fetches data using orm so i got this
15:24 PM
15:25 PM
why relationTypeId hardcoded like this isn't page suppose to show all relation an entity has ?
15:25 PM
monkey
This code is front-end code, so not related to fetching the data.
15:26 PM
This hardcode type gets extracted ffrom other relationships in order to be shown in a separate table, let me make a screenshot for you
15:26 PM
vishal5251 has quit
15:27 PM
15:27 PM
You will see a table of "Works" and below it "Relationships"
15:27 PM
Shubh
Yes so that means..
15:28 PM
monkey
All of these are relationships. The code you linked to extracts relationships of a certain type (edition contains work) to show them in that Works table
15:29 PM
But if you're looking for how to get data from the database you're looking in the wrong spot. I fyou describe what you're trying to resolve I can point you to a more relevant piece of code
15:29 PM
Shubh
wait isn't that code for showing relations in Relationships tab?
15:29 PM
monkey
15:30 PM
No this is the WorkDisplayPage
15:30 PM
15:31 PM
15:32 PM
Shubh
from where EntityRelationships component get its data i mean relations
15:32 PM
monkey
So for that we need to look at the server code (rather than the client code)
15:32 PM
Shubh
isn't it that specific line of code that fetches them?
15:33 PM
monkey
15:33 PM
N, again you're looking at front-end code which doesn't fetch anything.
15:34 PM
You want to be looking at files in src/server, not in src/client
15:35 PM
Shubh
but but that workPage
15:36 PM
let start again , how workpage (work/:bbid) load its data?
15:37 PM
monkey
15:37 PM
15:38 PM
And after that you see that middleware.loadEntityRelationships is called
15:38 PM
That's where we load relationships from the database
15:39 PM
And then all that is sent to the react components in entityRoutes.displayEntity
15:40 PM
Shubh
so that middleware responsible for loading relationships data in req.entity object?
15:40 PM
monkey
Correct
15:41 PM
15:41 PM
15:43 PM
Shubh
so to get data about relationships of an entity i have to add that middleware , correct?
15:43 PM
monkey
>so that middleware responsible for loading relationships data in req.entity object?
15:43 PM
actually they are loaded in `res.locals.entity` which is what is used
15:44 PM
Well, I guess it depends where.
15:44 PM
If you explained the issue you're trying to solve it would help
15:45 PM
Depending on what you're trying to modify, it's possible that the relationships are already loaded
15:45 PM
In which case the solution will be to figure out how to access them
15:47 PM
Shubh
is there way to access to them in client side like without getting that entity object with relations ..
15:48 PM
monkey
I still don't understand what you're trying to do. Which route are you modifying that doesn't have the entity and its relationships loaded already?
15:49 PM
Or which page I should say
15:52 PM
Shubh
I want to access the relationships data of an entity on /create entity page..
15:53 PM
vishal5251 joined the channel
15:53 PM
monkey
So for an entity that is being created (i.e that doesn't exist yet in the database), the relationships data is contained in the Redux state
15:54 PM
Including whatever data we fetch when adding a new relationship using the search dropdown
15:54 PM
Shubh
data of an entity *which already exist in database
15:59 PM
vishal5251
16:00 PM
monkey
16:00 PM
vishal5251
hey monkey, see there comes an error while installing packages.
16:01 PM
Shubh
vishal5251 it might help if you paste whole error log in pastebin
16:01 PM
monkey
Shubh: But we don't have access too all the entity's data here
16:03 PM
vishal5251: That's odd. You're running on Docker for Windows, is that correct?
16:04 PM
vishal5251
yeah
16:09 PM
monkey
vishal5251: I'll try to dig into the issue. I suspect this is a windows-only issue, which I won't be able to reproduce.
16:09 PM
The sort of thing that shouldn't happen with Docker, but…
16:10 PM
In the meantime if it help I think your instinctwas correct and you can remove the "postinstall" script in package.json
16:10 PM
16:10 PM
See if that allows you to build the image correctly
16:11 PM
As Shubh suggested, more debug logs could come in handy, which you can send as a pastebin for example
16:11 PM
16:12 PM
vishal5251
after removing that thing, it builds but I'll lost the connection with database
16:13 PM
monkey
Those two issues seem unrelated
16:14 PM
Shubh
16:14 PM
monkey
Please try building again with the script removed, and with the correct configuration you sent earlier