Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createTextMessage return null #445

Closed
zhangxqBeta opened this issue Dec 21, 2023 · 4 comments
Closed

createTextMessage return null #445

zhangxqBeta opened this issue Dec 21, 2023 · 4 comments
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@zhangxqBeta
Copy link

What happened?

使用这个方式创建一条消息,但是返回了null
Message msg = OpenIMClient.getInstance().messageManager.createTextMessage("xxxx");

init and login log:

2023-12-21 19:58:24.120 31559-31559 OpenIm                  com.nimispace.app                    D  openIm init
2023-12-21 19:58:24.160 31559-31665 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:24.160	�[34mINFO�[0m	�[34m[PID:31559]�[0m	[open_im_sdk/init_login.go:72]	InitSDK info	{"operationID": "1703159904130", "config": {"platformID":2,"apiAddr":"http://openim.test.conss.co","wsAddr":"ws://openim.test.conss.co/msg_gateway","dataDir":"/data/user/0/com.nimispace.app/files","logLevel":6,"isLogStandardOutput":true,"logFilePath":"","isExternalExtensions":false}, "sdkVersion": "openim-sdk-core-v3.0.0"}
2023-12-21 19:58:31.525 31559-31559 OpenIm                  com.nimispace.app                    D  login start id=love211kgu0jcw00, token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJsb3ZlMjExa2d1MGpjdzAwIiwiUGxhdGZvcm1JRCI6MiwiZXhwIjoxNzEwOTIzMDE0LCJuYmYiOjE3MDMxNDY3MTQsImlhdCI6MTcwMzE0NzAxNH0.LnnbOhU9Pofen8Sb83SB5orCU3q_uqIEPb82d8ovo2o
2023-12-21 19:58:31.527 31559-31654 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.526	�[34mINFO�[0m	�[34m[PID:31559]�[0m	[open_im_sdk/util.go:116]	input req	{"operationID": "1703159911525", "function name": "github.com/openimsdk/openim-sdk-core/v3/open_im_sdk.(*LoginMgr).Login-fm", "args": ["love211kgu0jcw00","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJsb3ZlMjExa2d1MGpjdzAwIiwiUGxhdGZvcm1JRCI6MiwiZXhwIjoxNzEwOTIzMDE0LCJuYmYiOjE3MDMxNDY3MTQsImlhdCI6MTcwMzE0NzAxNH0.LnnbOhU9Pofen8Sb83SB5orCU3q_uqIEPb82d8ovo2o"]}
2023-12-21 19:58:31.527 31559-31654 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.526	�[34mINFO�[0m	�[34m[PID:31559]�[0m	[db/db_init.go:129]	sqlite	{"operationID": "1703159911525", "path": "/data/user/0/com.nimispace.app/files/OpenIM_v3_love211kgu0jcw00.db"}
2023-12-21 19:58:31.529 31559-31654 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.528	�[37mDEBUG�[0m	�[37m[PID:31559]�[0m	[db/db_init.go:141]	open db success	{"operationID": "1703159911525", "dbError": "json: unsupported type: func() time.Time", "dbFileName": "/data/user/0/com.nimispace.app/files/OpenIM_v3_love211kgu0jcw00.db"}
2023-12-21 19:58:31.607 31559-31654 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.607	�[37mDEBUG�[0m	�[37m[PID:31559]�[0m	[log/sql_logger.go:86]	sql exec detail	{"operationID": "1703159911525", "gorm": "github.com/openimsdk/openim-sdk-core/[email protected]/pkg/db/conversation_model.go:50", "elapsed time": "0.468386(ms)", "rows": 0, "sql": "SELECT `conversation_id` FROM `local_conversations` WHERE latest_msg_send_time > 0"}
2023-12-21 19:58:31.607 31559-31654 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.607	�[37mDEBUG�[0m	�[37m[PID:31559]�[0m	[log/sql_logger.go:86]	sql exec detail	{"operationID": "1703159911525", "gorm": "github.com/openimsdk/openim-sdk-core/[email protected]/pkg/db/sending_messages_model.go:41", "elapsed time": "0.349271(ms)", "rows": 0, "sql": "SELECT * FROM `local_sending_messages`"}
2023-12-21 19:58:31.609 31559-31664 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.608	�[37mDEBUG�[0m	�[37m[PID:31559]�[0m	[log/sql_logger.go:86]	sql exec detail	{"operationID": "1703159911525", "gorm": "github.com/openimsdk/openim-sdk-core/[email protected]/pkg/db/conversation_model.go:76", "elapsed time": "0.205990(ms)", "rows": 0, "sql": "SELECT `conversation_id` FROM `local_conversations`"}
2023-12-21 19:58:31.609 31559-31664 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.608	�[37mDEBUG�[0m	�[37m[PID:31559]�[0m	[log/sql_logger.go:86]	sql exec detail	{"operationID": "1703159911525", "gorm": "github.com/openimsdk/openim-sdk-core/[email protected]/pkg/db/notification_model.go:43", "elapsed time": "0.129271(ms)", "rows": 0, "sql": "SELECT * FROM `local_notification_seqs` WHERE 1=1"}
2023-12-21 19:58:31.610 31559-31664 GoLog                   com.nimispace.app                    I  2023-12-21 11:58:31.610	�[37mDEBUG�[0m	�[37m[PID:31559]�[0m	[log/sql_logger.go:86]	sql exec detail	{"operationID": "1703159911525", "gorm": "github.com/openimsdk/openim-sdk-core/[email protected]/pkg/db/group_member_model.go:296", "elapsed time": "0.280156(ms)", "rows": 0, "sql": "SELECT DISTINCT group_id FROM `local_group_members`"}
2023-12-21 19:58:31.768 31559-31559 OpenIm                  com.nimispace.app                    D  connecting
2023-12-21 19:58:31.768 31559-31559 OpenIm                  com.nimispace.app                    D  login success data=""
2023-12-21 19:58:32.204 31559-31559 OpenIm                  com.nimispace.app                    D  connect success

create message log:

2023-12-21 20:11:25.700 31559-31661 GoLog                   com.nimispace.app                    I  2023-12-21 12:11:25.695	�[34mINFO�[0m	�[34m[PID:31559]�[0m	[open_im_sdk/util.go:247]	input req	{"operationID": "1703160685694", "function name": "github.com/openimsdk/openim-sdk-core/v3/internal/conversation_msg.(*Conversation).CreateTextMessage-fm", "args": ["xxd"]}
2023-12-21 20:11:25.703 31559-31727 GoLog                   com.nimispace.app                    I  2023-12-21 12:11:25.703	�[31mERROR�[0m	�[31m[PID:31559]�[0m	[log/sql_logger.go:71]	sql exec detail	{"operationID": "1703160685694", "gorm": "github.com/openimsdk/openim-sdk-core/[email protected]/pkg/db/user_model.go:31", "elapsed time": "2.535781(ms)", "rows": 0, "sql": "SELECT * FROM `local_users` WHERE user_id = \"love211kgu0jcw00\"  LIMIT 1", "error": "record not found"}
2023-12-21 20:11:25.707 31559-31727 GoLog                   com.nimispace.app                    I  2023-12-21 12:11:25.706	�[34mINFO�[0m	�[34m[PID:31559]�[0m	[open_im_sdk/util.go:375]	input req	{"operationID": "1703160685705", "function name": "github.com/openimsdk/openim-sdk-core/v3/internal/conversation_msg.(*Conversation).SendMessage-fm", "args": ["","love20x8ixbt8n40","",""]}
2023-12-21 20:11:25.739 31559-31559 OpenIm                  com.nimispace.app                    D  send msg onError: unexpected end of JSON input, code: 10002

What did you expect to happen?

How can we reproduce it (as minimally and precisely as possible)?

Anything else we need to know?

No response

version

```console $ {name} version # paste output here ```

Cloud provider

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

@zhangxqBeta zhangxqBeta added the bug Categorizes issue or PR as related to a bug. label Dec 21, 2023
@zhangxqBeta
Copy link
Author

消息创建需要api请求成功之后才可以,这个设计感觉有点不太合理,正常来说连接登录成功之后,消息就可以创建和发送了

@kubbot
Copy link
Contributor

kubbot commented Dec 22, 2023

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Message creation requires a successful API request. This design feels a bit unreasonable. Normally, messages can be created and sent after the connection and login are successful.

@yujieli
Copy link

yujieli commented Nov 1, 2024

消息创建需要api请求成功之后才可以,这个设计感觉有点不太合理,正常来说连接登录成功之后,消息就可以创建和发送了

请教一下,调用的哪个api

@OpenIM-Robot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Message creation requires a successful API request. This design feels a bit unreasonable. Normally, messages can be created and sent after the connection and login are successful.

Please tell me which API is called?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants