As we changed the messages table model to use a composite key in ENG-1362 we can use a composite key instead of an index in findMessageItem, removeMessageItem methods to improve database lookup performance.
Linear task: ENG-1493
Differential D4694
[services] Tunnelbroker - Change `findMessageItem`, `removeMessageItem` to use composite key • max on Aug 1 2022, 6:58 AM. Authored by Tags None Referenced Files
Details As we changed the messages table model to use a composite key in ENG-1362 we can use a composite key instead of an index in findMessageItem, removeMessageItem methods to improve database lookup performance. Linear task: ENG-1493 Run database-related unit tests using yarn run-unit-tests
Diff Detail
Event TimelineComment Actions
If we're relying on the tests, we need to make sure that they are really helpful. If the tests were passing before this change and after it, are we really sure that our change changes anything? The solution to that issue is to introduce a test which would be failing with the older code but is now passing - do you think it is possible to have such a test? Comment Actions Thanks for a comment @tomek ! The test is passing because the test file is changed too due to the function changes. I don't think we need another test that fails if using old methods instead because the updated tests will fail. |