Update to latest backup integration tests

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2025-01-28 15:16:52 -06:00 committed by GitHub
parent 9f5602af05
commit 539ebb14dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View file

@ -194,7 +194,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'signalapp/Signal-Message-Backup-Tests'
ref: '22d7f507b61691e0a7da1fd4b233f219bdaf2280'
ref: '93a7d29527cb33e6bf23bc56fbf74d62cf682001'
path: 'backup-integration-tests'
- run: xvfb-run --auto-servernum npm run test-electron

View file

@ -729,8 +729,10 @@ message BodyRange {
MONOSPACE = 5;
}
optional uint32 start = 1;
optional uint32 length = 2;
// 'start' and 'length' are measured in UTF-16 code units.
// They may refer to offsets in a longText attachment.
uint32 start = 1;
uint32 length = 2;
oneof associatedValue {
bytes mentionAci = 3;

View file

@ -310,9 +310,9 @@ message DataMessage {
STRIKETHROUGH = 4;
MONOSPACE = 5;
}
optional uint32 start = 1;
optional uint32 length = 2;
optional uint32 start = 1; // Starting index in UTF-16 code units/raw string representation
optional uint32 length = 2; // Length of range in UTF-16 code units/raw string representation
oneof associatedValue {
string mentionAci = 3;

View file

@ -171,11 +171,9 @@ export function filterAndClean(
return ranges
.map(range => {
const { start, length, ...restOfRange } = range;
if (!isNumber(start)) {
log.warn('filterAndClean: Dropping bodyRange with non-number start');
return undefined;
}
const { start: startFromRange, length, ...restOfRange } = range;
const start = startFromRange ?? 0;
if (!isNumber(length)) {
log.warn('filterAndClean: Dropping bodyRange with non-number length');
return undefined;