[core] throw AssertionError if SessionId is missing

Also remove stale comment
This commit is contained in:
Torsten Grote
2019-10-09 08:27:33 -03:00
parent 9660ff2fff
commit e3e47dae48
2 changed files with 5 additions and 8 deletions

View File

@@ -583,9 +583,11 @@ class IntroductionManagerImpl extends ConversationClientImpl
throw new DbException(e);
}
if (m.getSessionId() == null) {
// this can only be an unhandled REQUEST message
// that does not yet have a SessionId assigned
continue;
// This can only be an unhandled REQUEST message.
// Its session is created and stored in incomingMessage(),
// and getMessageMetadata() only returns delivered messages,
// so the session ID should have been assigned.
throw new AssertionError("missing session ID");
}
// get session from map or database
DeletableSession session = sessions.get(m.getSessionId());

View File

@@ -1349,11 +1349,6 @@ public class IntroductionIntegrationTest
assertFalse(deleteAllMessages0From2());
}
/**
* This test is testing that a session's deletable flag gets reset
* when the session is used again,
* so that it can not cause a session to get deleted prematurely.
*/
@Test
public void testDeletingOneSideOfSession() throws Exception {
addListeners(false, false);