Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Buddy request error #229

Open
WaaromZoMoeilijk opened this issue Aug 5, 2015 · 3 comments
Open

Buddy request error #229

WaaromZoMoeilijk opened this issue Aug 5, 2015 · 3 comments
Labels

Comments

@WaaromZoMoeilijk
Copy link

Hey,

First of all great app thanks! It worked like a charm, except for today, don't know what went wrong. Using owncloud 8.1, latest version of the chat app, with owncloud chat not xmpp.

I just get a blank screen and this notification, hope anyone can help!

Kind regards,

Ezra

ps: already tried fresh app files, doesnt work.

schermafdruk van 2015-08-05 21 50 28

@LEDfan
Copy link
Contributor

LEDfan commented Aug 24, 2015

Hi, sorry for the late answer I was busy with other things...

A few questions:

  • did you downloaded it from the app store?
  • are there any errors in the browser log?
  • are there any errors in the ownCloud log?

Thanks!

@LEDfan LEDfan added the bug label Aug 24, 2015
@L45eMy
Copy link

L45eMy commented Sep 8, 2015

Bug seems to appear when a user was deleted. The ownCloud log shows:
Undefined index: DeletedUser at …/apps/chat/lib/och/data/getusers.php#31

@clangguth
Copy link

I've just seen the same happen here (owncloud 8.1.1, chat installed from within owncloud using the experimental addons and no further configuration).

This seems to be caused by the app creating an entry for every possible combination of 2 users. I don't think that this really makes sense in the first place, as it will result in a combinatorial explosion of the number of entries. For a mere 50 users, this will already result in 1225 combinations, for 500 it will be 124750...

The fix is simple: A conversation entry for (A,B) should only be created if there has been at least one message from A to B or B to A.

In the mean time, here is workaround that temporarily solves the issue with deleted accounts. That's a sequence of mysql commands, to be issued once connected to the correct database (mysql owncloud for me). I've included some of the intermediate queries I used to figure out the final ones, and I didn't really optimize the queries. You can copy/paste this (it should work... well it did for me at least), but I'm not making any guarantees. If you want to be prudent, run it line by line (including the select statements to ensure the thing does what it should do), and if you run a different DBS, you might need to adapt the queries.

As said, this is a quick and dirty fix -- use at your own risk!

-- (1) list all currently valid users
-- select uid from oc_users_external union select uid from oc_users;

-- (2) delete obsolete conversation entries (by user, using (1)):
delete from oc_chat_och_users_in_conversation where user not in (select uid from oc_users_external union select uid from oc_users);

-- (3) find obsolete conversation ids:
-- select t.conv_id from (select conversation_id as conv_id, count(*) as participants from oc_chat_och_users_in_conversation group by conv_id) as t where t.participants < 2;

-- (4a) find obsolete conversations:
-- select * from oc_chat_och_conversations where conversation_id in (select t.conv_id from (select conversation_id as conv_id, count(*) as participants from oc_chat_och_users_in_conversation group by conv_id) as t where t.participants < 2);
-- (4b) delete obsolete conversations:
delete from oc_chat_och_conversations where conversation_id in (select t.conv_id from (select conversation_id as conv_id, count(*) as participants from oc_chat_och_users_in_conversation group by conv_id) as t where t.participants < 2);

-- (5a) find obsolete messages:
select * from oc_chat_och_messages where not exists(select * from oc_chat_och_conversations cc where cc.conversation_id = convid);
-- (5b) find obsolete messages:
delete from oc_chat_och_messages where not exists(select * from oc_chat_och_conversations cc where cc.conversation_id = convid);

-- (6a) find obsolete push messages:
select * from oc_chat_och_push_messages where sender not in (select uid from oc_users_external union select uid from oc_users) or receiver not in (select uid from oc_users_external union select uid from oc_users);
-- (6b) delete obsolete push messages:
select * from oc_chat_och_push_messages where sender not in (select uid from oc_users_external union select uid from oc_users) or receiver not in (select uid from oc_users_external union select uid from oc_users);


-- (7a) find obsolete conversation entries (by conversation)
-- select * from oc_chat_och_users_in_conversation where conversation_id not in (select conversation_id from oc_chat_och_conversations);
-- (7b) delete obsolete conversation entries(by conversation)
delete from oc_chat_och_users_in_conversation where conversation_id not in (select conversation_id from oc_chat_och_conversations);

In any case, thanks for the chat app! :-) I hope this helps to (temporarily) solve the problem, as well as as constructive feedback for the app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants