4
1
Fork 0

fix: cannot create group, or add group members to the group #16

Open
opened 2019-07-27 12:25:26 +08:00 by sudharshan · 7 comments

The following code is unable to create a group in the frontend

          final conversation = await conversationApiProvider
              .createConversation(nameController.text, profile: _image);

          for (var user in widget.users) {
            print(user);
            await conversationApiProvider.createConversationMember(
                conversation.id, user.id);
          }
          Navigator.pushNamed(context, "conversation/home");
The following code is unable to create a group in the frontend final conversation = await conversationApiProvider .createConversation(nameController.text, profile: _image); for (var user in widget.users) { print(user); await conversationApiProvider.createConversationMember( conversation.id, user.id); } Navigator.pushNamed(context, "conversation/home");
daniel self-assigned this 2019-07-27 12:35:52 +08:00

We need clarification on whether this is fixed yet

We need clarification on whether this is fixed yet
ambrose reopened this issue 2019-07-27 18:56:51 +08:00
Poster
Owner

It is not.

sometimes the getConversationMembers endpoint returns Internal Server Error like randomly
not just for new conversations
but like for existing ones too
and you end up with this, because it uses the conversation members list to decide whether to show a UserAvatar or a GroupAvatar

It is not. > sometimes the getConversationMembers endpoint returns Internal Server Error like randomly not just for new conversations but like for existing ones too and you end up with this, because it uses the conversation members list to decide whether to show a UserAvatar or a GroupAvatar
Poster
Owner
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unexpected character (at character 1)
Internal Server Error
^

#0      ConversationApiProvider.fetchConversationMembers (package:frontend_flutter/src/resources/conversation_api_provider.dart:103:7)
<asynchronous suspension>
#1      ConversationMembersBloc.fetchMembers (package:frontend_flutter/src/blocs/conversation_bloc.dart:37:25)
<asynchronous suspension>
#2      _ConversationItemState.initState (package:frontend_flutter/src/ui/widgets/conversation_item.dart:30:10)
#3      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4033:58)
#4      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
#5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
#6      Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
#7      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5092:14)
#8      Element.inflateWidget (packa<…>
``` [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unexpected character (at character 1) Internal Server Error ^ #0 ConversationApiProvider.fetchConversationMembers (package:frontend_flutter/src/resources/conversation_api_provider.dart:103:7) <asynchronous suspension> #1 ConversationMembersBloc.fetchMembers (package:frontend_flutter/src/blocs/conversation_bloc.dart:37:25) <asynchronous suspension> #2 _ConversationItemState.initState (package:frontend_flutter/src/ui/widgets/conversation_item.dart:30:10) #3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4033:58) #4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5) #5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14) #6 Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12) #7 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5092:14) #8 Element.inflateWidget (packa<…> ```
ambrose self-assigned this 2019-08-02 21:24:12 +08:00
daniel was unassigned by ambrose 2019-08-02 21:24:13 +08:00
ambrose started working 2019-08-02 21:24:15 +08:00
ambrose cancelled time tracking 2019-08-03 20:58:37 +08:00

Backend throws no error, but user doesn't get added.

Backend throws no error, but user doesn't get added.

Okay, backend doesn't add user because it checks the DM property and if it's set it silently doesn't add the user. 😞

Okay, backend doesn't add user because it checks the DM property and if it's set it *silently* doesn't add the user. :disappointed:

Use the DM flag when creating conversations.

Use the DM flag when creating conversations.
Poster
Owner

for the create members thing
it already uses dm = false
when sending the request
also i discovered this
the DMs already populated in the database use dm = false, when shouldn't it be dm = true
i tried flipping the dm=false to dm=true and sending the request to the server to create a conversation and add conversation members, but now the server throws Internal Server Error when returning all user conversations

for the create members thing it already uses dm = false when sending the request also i discovered this the DMs already populated in the database use dm = false, when shouldn't it be dm = true i tried flipping the dm=false to dm=true and sending the request to the server to create a conversation and add conversation members, but now the server throws Internal Server Error when returning all user conversations
ambrose added a new dependency 2019-10-23 23:06:40 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
Reference: beep/backend-core#16
There is no content yet.