libera/#maemo-leste/ Tuesday, 2024-05-21

freemangordonright, ChatWindow needs lots of refactoring/cleanup,00:05
freemangordonbut, time for zzz, night!00:05
dsc_gn00:08
freemangordondsc_: why explicit clear here: https://github.com/maemo-leste/conversations/blob/master/src/chatwindow.cpp#L251 ?07:29
freemangordonok, do you mind if I refactor ChatWindow to remove   m_chatMessage ?07:33
freemangordonanyway it seems broken https://github.com/maemo-leste/conversations/blob/master/src/chatwindow.cpp#L15107:34
freemangordondsc_: https://pastebin.com/EqFMMhKG09:02
freemangordonthis happens if I do offline->online09:02
Wizzupfreemangordon: that could be what I mentioned earlier, using a channel that is invalidated, but I would reckon that we also removing it from the qmap when it is invalidated10:46
dsc_freemangordon: regarding specific TP questions, I am not a fan of lib/tp.cpp, tpqt, and rtcom in general, so asking me why hasChannel segfaults - i have no idea. Historically Wizzup has been working more on that side of the code anyway.11:20
uvos__Wizzup: the bouncing vhold on the xt91x is global everywere11:21
dsc_I can find out why it would segfault, but it takes me like +30min to even get familiar again with what happens, the terminology, etc.11:21
uvos__Wizzup: just a note btw tdlib has som issues in conversations11:22
uvos__1. only remote party notifications are fetched11:22
uvos__if i have a conversation with smeone via telegram later conversations will only have the messages of the other party, my own messages are missing11:23
uvos__2. when im present in leste all messages by sent by anyone are automaticly set to "seen" by leste11:24
uvos__this is very undesirable as any time the leste device is active all other telegram clients dont get any notification11:24
uvos__dsc_: conversations sphone module maybe? :P11:25
dsc_the only reason conversations uses rtcom is so can read a sqlite db, but in Qt we generally use Qt SQL for it11:27
dsc_well, rtcom goes via dbus, maybe it does some extra things, I am not sure. But I feel like it is unnecessarily complex.11:27
dsc_(or maybe rtcom does not go via dbus, i dont even know... :P)11:28
uvos__oh you just mean rtcom-el11:31
uvos__in pricipal rtcom is the whole stack11:31
dsc_yes, rtcom-el11:31
uvos__rtcom-el is pretty wierd yeah11:32
uvos__its both overgeneered and lacking11:32
dsc_also we need to mix glib in Qt because of it11:32
dsc_uvos__: marked as 'seen' is one of the more recent features11:35
dsc_ill note your description11:35
dsc_im working on such issues this week11:35
Wizzupuvos__: check @ bouncing11:37
Wizzupuvos__: I agree @ missing your own messages, I think we might ignore those somehow, will look (or dsc will)11:37
dsc_I was going to check memory increases today but ill wait for fmg's constructor refactor now :P11:37
uvos__dsc_: ok to be clear the problem is that messages are marked as seen when  no conversations window is not open at all11:52
uvos__merly the present sate is enough11:52
uvos__tdlib seams to think that all chats are open and active at all times11:52
uvos__hence no notifications for other devices11:53
Wizzupyeah, this might be what freemangordon fixing in tp-haze11:53
Wizzupand then supporting in conversations11:53
Wizzup(chat state)11:53
Wizzupdsc_: we use rtcom because maemo uses rtcom, like, for everything related to real time communications11:54
Wizzupand yes it does more than just 'log to a database'11:54
WizzupI think we're past that point now so it would be nice if we could stop having to doubt this frequently :D11:54
uvos__not a whole lot more really tho11:55
uvos__for rtcom-el11:55
uvos__it would be quite feasbale to just implement it again qtsql11:55
Wizzupit's read by notifications too11:55
Wizzupalso used for persistent notifications11:55
Wizzupand it does a ton of stuff that you might not know about if you just reimplement it11:55
uvos__if the interface is getting in the way11:56
Wizzupit is not11:56
Wizzupthere is no issue in mixing glib and qt, it's not causing us problems11:56
uvos__Wizzup: rtcom-el is simply very few lines of code11:56
uvos__Wizzup: so you could absolutly not miss anything11:56
Wizzup14k lines of code11:58
Wizzup8.5k without ui code11:59
Wizzupso no, it's not very little11:59
dsc_09:55 < uvos__> it would be quite feasbale to just implement it again qtsql if the interface is getting in the way11:59
dsc_yep, this11:59
Wizzupnow, as far as the telepathy segfault, I can take a look but I need freemangordon's changes to do so12:00
WizzupI don't mind looking at the tp code at all which is the divisions we've had before so there's no need to change it now12:00
dsc_< Wizzup> there is no issue in mixing glib and qt <== this is simply not true, by having glib and Qt you have introduced more dependencies to link against at the minimum, and at the maximum you have made querying a sqlite database a lot more complicated12:01
WizzupI am not going to have this discussion again, sorry, this is super pointless12:01
WizzupIf you can't see why having to maintain two separate code bases for accessing rt com messages is not a nightmare then I don't know what to say12:02
WizzupI also don't remember a single crash caused by using both glib and qt12:04
dsc_there are issues by having this setup and I cannot talk about them12:04
dsc_or they are ignored12:04
dsc_which is fine, but I keep bringing them so it is clear that part of the code is not what I would have preferred, e.g when fmg asks to do something I can say "i dont know" :)12:05
dsc_them up*12:05
Wizzupyes, like I said, I am happy to look at the tp stuff12:05
Wizzupjust bounce it to me then12:05
Wizzuptp stuff or rtcom stuff12:05
Wizzup11:21 < uvos__> Wizzup: the bouncing vhold on the xt91x is global everywere12:07
Wizzupok, it would be nice if we could try to fix it somehow, I can make some time again this week(end)... we have a lot of nlnet stuff to claim for devices and it's almost all like 99% of the way there (at least that is what it feels like)12:08
Wizzupdid you need certain data from android on razr?12:08
Wizzupdsc_: btw it looks to me like _removeChannel should remove the channel from the channels QMap12:19
Wizzupbecause otherwise we keep invalid channels/pointers around12:19
dsc_if it keeps the keys around, I did so for a purpose12:21
dsc_most likely to facilitate the auto-join group feature12:21
dsc_and/or keep track of which channels it should join, but has not joined yet12:21
Wizzupthe channels private qmap is only to keep track of telepathychannels that are valid12:22
WizzupI don't think it stores anything related to autojoin12:22
dsc_ill check12:22
WizzupI think those are different, and if we store things for autojoin we should just store the account + channel string12:22
Wizzupok, I can also check, I just wanted to communicate what is likely the issue12:22
dsc_hasChannel checks for key and value12:27
dsc_as the presence of a key does not mean its valid12:28
dsc_due to the reasons above12:29
dsc_thats how it was written anyway12:29
dsc_we could change that if thats better, im not sure12:30
WizzupI don't think there is a point to keeping invalidated channels around, right?12:30
Wizzupat least to me that feels like keeping around pointers to freed memory12:30
Wizzupbut maybe I am missing something12:31
dsc_yes that shouldnt happen12:33
dsc_somewhere it should destroy, and also set nullptr12:33
Wizzupso I think _removeChannel is called when we are informed that the channel is no longer usable, and then telepathyqt just removes it12:35
Wizzupso I think it gets destroyed already (I am not sure, I can check a bit later) and our nulling would be removing it from the qmap12:35
dsc_there's also leaveChannel()12:36
WizzupI think leavechannel can just ask to leave the channel and then _removeChannel will be called eventually12:36
Wizzupbut that is my bet12:36
dsc_leaveChannel actually removes the key12:37
Wizzupyeah I saw it does currently, but I am not sure if it has to if _removeChannel does it12:37
WizzupI think they could both do it though, then one just becomes a no-op12:37
dsc_right yeah12:37
dsc_uvos__: regarding point 1 "my own messages are missing", could you re-try with a fresh rtcom db?12:50
dsc_just as a quick test12:50
dsc_i suspect that will just work12:51
uvos__dsc_: shure i will12:54
uvos__can you remind me where the db is stored again12:55
dsc_uvos__: ~/.rtcom-eventlogger/12:55
dsc_el-v1.db12:56
dsc_< uvos__> 2. when im present in leste all messages by sent by anyone are automaticly set to "seen" by leste <== 90% sure Conversations does not do this, message are only marked as 'read' when chatWindow is opened, once12:56
dsc_maybe the telegram plugin does?12:57
uvos__maybe unfotionatly theres a lot of layers involved here12:57
uvos__any one of them could be at fault12:57
Wizzupthe best way to verify if we get them at all is to look at dbus-monitor when we send a message from a different device13:00
Wizzupthen we will know if conversations receives it from tp-haze13:00
Wizzupif it does, then we can fix conversations to store it correctly13:00
Wizzupotherwise we need to look at haze, and if haze doesn't even get it, then we need to look at tdlib purple13:00
Wizzup(which could be tested from within pidgin, without any tp stuff, to see if pidgin gets these messages)13:01
dsc_i may have identified rtcom-el as the cause for some mem increases (or how conversations uses it)16:22
dsc_needs further investigation before drawing conclusions though, so brb16:23
dsc_results seem promising17:35
freemangordondsc_: as a side note: qt itself uses glib behind the scenes17:56
freemangordonso qt vs glib is simply pointless17:56
freemangordonto me it seems the checks in hasChannel are not enough17:57
freemangordonWizzup: sure, I can provide the code17:57
freemangordoncode changes that is17:57
freemangordonbut I am almost sure segfault is unrelated, besides that is calls hasChannel() buy the time channels map contains dangling pointers17:58
freemangordonwhich should not happen17:58
freemangordon*by the time17:58
Wizzupyes, I think we discussed this backlog18:09
Wizzupdsc_: cool @ memory!18:12
arno11dsc_: great @ memory !!!18:18
dsc_i just need to check if its my fault before I explain what I found (so I can prepare everyone making fun of me ;'))18:22
dsc_but yes pretty sure this improves things18:23
dsc_but im also not satisfied with QML but thats a different story18:23
dsc_brb18:23
dsc_old leak re-fixed: https://github.com/maemo-leste/conversations/commit/a2bb39114de7bd0e2d10125af967034aad6ac60819:46
dsc_new leak: https://github.com/maemo-leste/conversations/commit/fe402cca7f02ec7f1d385a3f907de3ad5fffac7919:46
dsc_it has a noticeable difference19:46
dsc_however I am still not satisfied with some memory usage, possibly related to QML/ChatWindow (opening and closing doesnt return the 'expected' amount of memory)19:47
dsc_so ill continue tomorrow19:48
freemangordondsc_: qml will not free until GC is run20:38
freemangordonso maybe run GC manually before measuring memory usage20:38
Wizzupdsc_: great work!21:21
WizzupI think we can make a new -devel release with just this21:22
freemangordonWizzup: do you want my changes or you could give me a hint where to remove the channel (and when)21:32
Wizzupsure, I did mention a fix in the backlog, which is to do channels.remove(...) in _removeChannel21:34
Wizzupbut if you push the code to a branch I can take a look too21:34
dsc_freemangordon: closing a chatWindow destroys the QML widget in its entirety, but memory usage doesnt return close to what it was21:34
Wizzupdsc_: if you do that a few times, does it still increase?21:34
dsc_Wizzup: it does, but it stops after a while. its not linear21:34
Wizzupthe first time might be some cache in qt / loading new so's21:34
Wizzuphm21:34
Wizzupdsc_: shall I make a new -devel release?21:35
dsc_yes21:35
dsc_thanks21:35
dsc_i also did some testing today with javascript's gc()21:38
dsc_but I dont have anything to report on that front yet21:39
freemangordonWizzup: ok, will try21:39
dsc_Wizzup: i'd like to get one more thing in21:50
dsc_(if you did not update already)21:50
Wizzupah21:50
Wizzupok, let me git tag -d the tag21:50
freemangordonalso, I am about to push segfault fix21:51
freemangordonif you like it https://pastebin.com/B7yAWq7C21:51
Wizzuplooks good to me (assuming it works)21:52
freemangordonabout to test21:53
freemangordonseems to not segfault anymore, going to push it21:56
dsc_pushed22:03
freemangordonWizzup: pushed22:12
freemangordonalong with chat state functionality22:13
Wizzupcool22:17
freemangordonwill you make anotehr release?22:18
Wizzupyes,now22:19
freemangordonok, thanks22:19
freemangordondsc_: pressing ENTER key does not send messages in either VM or D422:20
freemangordonWizzup: will try to push haze fixes today22:20
dsc_freemangordon: its in Settings22:20
dsc_but it also requires a restart of chatWindow, still need to fix22:21
freemangordonhow to access those settings?22:21
dsc_on the overview window -> menu bar -> Settings22:21
freemangordonhmm, trying to open conversations while a chat is opened just raises that chat22:23
arno11i just tried the new release: it is really faster to receive and open sms chat window on N90022:53
dsc_cool22:56
dsc_https://github.com/Karry/osmscout-sailfish/blob/master/src/MemoryManager.cpp23:03
dsc_every 10min it checks device memory, and forces Javascript collection and/or malloc_trim(0)23:03
dsc_might be interesting to explore23:04
dsc_but my question is, why Qt keeps some memory after destroying the chatwindow23:12
dsc_need to investigate that23:13

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!