Regression tests: a file sent into a room goes to the room's chat #2
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/room-file-send"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Report: sending a file into a group made a phantom contact with the group's address and sent the file there.
Already fixed in
bd4a3d5("call fixes"): files and voice notes now go to the room's chat (room@service?join), as text does. libtacky tells a group send from a 1:1 one by that suffix alone, so a bare room JID was a private message to the room and a new 1:1 chat in the list. The build that showed the bug predates that commit.This PR adds regression tests only (
AnotherIMTests/AttachmentRoomSendTests.swift):chat=room@service?join, unchanged;Not covered:
ChatViewModel's half (AppEnvironment.makeForTestingbuilds no attachment service).A phantom chat already in someone's list stays until deleted.
Tested:
gmake teston the iPhone 18 Pro simulator (iOS 27.0): 362 tests, 0 failures (359 on master). SwiftLint: nothing on the file.🤖 Generated with Claude Code
?joinsuffix onchatalone (DeriveAddressing), andmessage send_filestores the row under the chat it is given, so a bare room JID was a type=chat message to the room and a new 1:1 conversation in the list.bd4a3d5already fixed it (ChatViewModel hands AttachmentServicechatJID, and the chat stays a String through PendingUpload); the build that showed it predates that commit. AnotherIMTests/AttachmentRoomSendTests.swift pins the service's half: a picked file and a voice note in a room ask for the slot and send withchat=room@service?joinas given, and a failed upload is listed under that chat, not the bare JID. Nothing tests ChatViewModel's half yet: AppEnvironment.makeForTesting builds no attachment service. gmake test on the iPhone 18 Pro simulator (iOS 27.0): 362 tests, 0 failures (359 on master); swiftlint reports nothing on the file. a8d18f33a2