Skip to content
New issue

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

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

Already on GitHub? # to your account

bug in add_message and test_chat_manager did not crash it always #2434

Closed
ReimarBauer opened this issue Jul 9, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working mscolab tests
Milestone

Comments

@ReimarBauer
Copy link
Member

the test Test_Chat_Manager.test_add_message wants to write

parameters = {'created_at': datetime.datetime(2024, 7, 9, 16, 19, 24, 604469, tzinfo=datetime.timezone.utc), 'message_type': 'TEXT', 'op_id': 'europe', 'reply_id': None, ...}

but op_id is defined as integer
op_id = db.Column(db.Integer, db.ForeignKey('operations.id'))

I have yet not looked up if this is in more than the test happening

@ReimarBauer ReimarBauer added question Further information is requested bug Something isn't working labels Jul 9, 2024
@ReimarBauer ReimarBauer added this to the 9.1.1 milestone Jul 9, 2024
@ReimarBauer
Copy link
Member Author

It is a bug because mismatch in chat_manager.add_message and the failure may become fixed in add_message for stable

https://github.com/Open-MSS/MSS/blob/stable/mslib/mscolab/chat_manager.py#L45

add_message needs to query the op_id from the operation_name and use this with Message, because Message is defined as

https://github.com/Open-MSS/MSS/blob/stable/mslib/mscolab/models.py#L189
def __init__(self, op_id, u_id, text, message_type=MessageType.TEXT, reply_id=None):

for develop we can redesign the API to use op_id instead of the operation_name.

@ReimarBauer ReimarBauer changed the title problem in test_chat_manager bug in add_message and test_chat_manager did not crash it always Jul 9, 2024
@ReimarBauer
Copy link
Member Author

most of the test treat it as op.id, but we have to lookup if that is always an int.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working mscolab tests
Projects
None yet
Development

No branches or pull requests

1 participant