diff --git a/package.json b/package.json index ef0054c4c..af22056a3 100644 --- a/package.json +++ b/package.json @@ -170,7 +170,7 @@ "rotating-file-stream": "2.1.5", "sanitize.css": "11.0.0", "semver": "5.4.1", - "sharp": "0.29.3", + "sharp": "0.30.5", "split2": "4.0.0", "testcheck": "1.0.0-rc.2", "typeface-inter": "3.10.0", diff --git a/ts/groups.ts b/ts/groups.ts index 054ddbb1f..8b643a751 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -4762,7 +4762,7 @@ async function applyGroupChange({ if (actions.modifyTitle) { const { title } = actions.modifyTitle; if (title && title.content === 'title') { - result.name = title.title; + result.name = dropNull(title.title); } else { log.warn( `applyGroupChange/${logId}: Clearing group title due to missing data.` @@ -4786,8 +4786,9 @@ async function applyGroupChange({ disappearingMessagesTimer && disappearingMessagesTimer.content === 'disappearingMessagesDuration' ) { - result.expireTimer = - disappearingMessagesTimer.disappearingMessagesDuration; + result.expireTimer = dropNull( + disappearingMessagesTimer.disappearingMessagesDuration + ); } else { log.warn( `applyGroupChange/${logId}: Clearing group expireTimer due to missing data.` @@ -4959,7 +4960,7 @@ async function applyGroupChange({ if (actions.modifyDescription) { const { descriptionBytes } = actions.modifyDescription; if (descriptionBytes && descriptionBytes.content === 'descriptionText') { - result.description = descriptionBytes.descriptionText; + result.description = dropNull(descriptionBytes.descriptionText); } else { log.warn( `applyGroupChange/${logId}: Clearing group description due to missing data.` @@ -5039,7 +5040,12 @@ export async function decryptGroupAvatar( ); } - return blob.avatar; + const avatar = dropNull(blob.avatar); + if (!avatar) { + throw new Error('decryptGroupAvatar: Returned blob had no avatar set!'); + } + + return avatar; } // Ovewriting result.avatar as part of functionality @@ -5123,7 +5129,7 @@ async function applyGroupState({ // Note: During decryption, title becomes a GroupAttributeBlob const { title } = groupState; if (title && title.content === 'title') { - result.name = title.title; + result.name = dropNull(title.title); } else { result.name = undefined; } @@ -5138,7 +5144,9 @@ async function applyGroupState({ disappearingMessagesTimer && disappearingMessagesTimer.content === 'disappearingMessagesDuration' ) { - result.expireTimer = disappearingMessagesTimer.disappearingMessagesDuration; + result.expireTimer = dropNull( + disappearingMessagesTimer.disappearingMessagesDuration + ); } else { result.expireTimer = undefined; } @@ -5268,7 +5276,7 @@ async function applyGroupState({ // descriptionBytes const { descriptionBytes } = groupState; if (descriptionBytes && descriptionBytes.content === 'descriptionText') { - result.description = descriptionBytes.descriptionText; + result.description = dropNull(descriptionBytes.descriptionText); } else { result.description = undefined; } @@ -5970,7 +5978,7 @@ export function decryptGroupTitle( ); if (blob && blob.content === 'title') { - return blob.title; + return dropNull(blob.title); } return undefined; @@ -5990,7 +5998,7 @@ export function decryptGroupDescription( ); if (blob && blob.content === 'descriptionText') { - return blob.descriptionText; + return dropNull(blob.descriptionText); } return undefined; diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index f01f8ab70..d5d1e3715 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -5776,12 +5776,6 @@ "updated": "2018-09-18T19:19:27.699Z", "reasonDetail": "Hard-coded string" }, - { - "rule": "jQuery-$(", - "path": "node_modules/protobufjs/dist/protobuf.min.js", - "reasonCategory": "falseMatch", - "updated": "2018-09-19T21:59:32.770Z" - }, { "rule": "jQuery-load(", "path": "node_modules/protobufjs/dist/protobuf.min.js", @@ -7700,13 +7694,6 @@ "reasonCategory": "falseMatch", "updated": "2020-04-30T22:45:07.878Z" }, - { - "rule": "jQuery-$(", - "path": "node_modules/sharp/lib/libvips.js", - "line": " const brewPkgConfigPath = spawnSync('which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR', spawnSyncOptions).stdout || '';", - "reasonCategory": "falseMatch", - "updated": "2019-12-11T01:10:06.091Z" - }, { "rule": "jQuery-load(", "path": "node_modules/signal-exit/index.js", diff --git a/yarn.lock b/yarn.lock index 319d31003..7887493bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5683,7 +5683,7 @@ color-name@^1.0.0, color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@1.7.4, color-string@^1.7.4: +color-string@1.7.4, color-string@^1.9.0: version "1.7.4" resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.7.4.tgz#79a7bf242610a8aa1b5e2681f3bf6bcfa666245f" integrity sha512-nVdUvPVgZMpRQad5dcsCMOSB5BXLljklTiaxS6ehhKxDsAI5sD7k5VmFuBt1y3Rlym8uulc/ANUN/bMWtBu6Sg== @@ -5696,13 +5696,13 @@ color-support@^1.1.2, color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -color@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/color/-/color-4.0.2.tgz#8bdb639132a37ae8823fd672de5180d0988fca80" - integrity sha512-fSu0jW2aKQG2FHlDywqdFPdabJHsUdZ0xabSt3wFZdcgRKtLnUHs19nUtuFuLGVMFhINGgfZEIjbUOsGZXGu7Q== +color@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a" + integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A== dependencies: color-convert "^2.0.1" - color-string "^1.7.4" + color-string "^1.9.0" colorette@^1.2.1: version "1.2.2" @@ -6508,6 +6508,11 @@ detect-libc@^1.0.2, detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +detect-libc@^2.0.0, detect-libc@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.1.tgz#e1897aa88fa6ad197862937fbc0441ef352ee0cd" + integrity sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w== + detect-node@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" @@ -11566,10 +11571,10 @@ node-abi@^3.3.0: dependencies: semver "^7.3.5" -node-addon-api@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.2.0.tgz#117cbb5a959dff0992e1c586ae0393573e4d2a87" - integrity sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q== +node-addon-api@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.0.0.tgz#7d7e6f9ef89043befdb20c1989c905ebde18c501" + integrity sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA== node-dir@^0.1.10: version "0.1.17" @@ -12834,12 +12839,12 @@ prebuild-install@^6.0.0: tar-fs "^2.0.0" tunnel-agent "^0.6.0" -prebuild-install@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.0.0.tgz#3c5ce3902f1cb9d6de5ae94ca53575e4af0c1574" - integrity sha512-IvSenf33K7JcgddNz2D5w521EgO+4aMMjFt73Uk9FRzQ7P+QZPKrp7qPsDydsSwjGt3T5xRNnM1bj1zMTD5fTA== +prebuild-install@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.0.tgz#991b6ac16c81591ba40a6d5de93fb33673ac1370" + integrity sha512-CNcMgI1xBypOyGqjp3wOc8AAo1nMhZS3Cwd3iHIxOdAUbb+YxdNuM4Z5iIrZ8RLvOsf3F3bl7b7xGq6DjQoNYA== dependencies: - detect-libc "^1.0.3" + detect-libc "^2.0.0" expand-template "^2.0.3" github-from-package "0.0.0" minimist "^1.2.3" @@ -14378,14 +14383,7 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -semver@^7.3.7: +semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -14532,17 +14530,17 @@ shallowequal@^1.1.0: resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== -sharp@0.29.3: - version "0.29.3" - resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.29.3.tgz#0da183d626094c974516a48fab9b3e4ba92eb5c2" - integrity sha512-fKWUuOw77E4nhpyzCCJR1ayrttHoFHBT2U/kR/qEMRhvPEcluG4BKj324+SCO1e84+knXHwhJ1HHJGnUt4ElGA== +sharp@0.30.5: + version "0.30.5" + resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.30.5.tgz#81c36fd05624978384ac6bd2744d23f9c82edefd" + integrity sha512-0T28KxqY4DzUMLSAp1/IhGVeHpPIQyp1xt7esmuXCAfyi/+6tYMUeRhQok+E/+E52Yk5yFjacXp90cQOkmkl4w== dependencies: - color "^4.0.1" - detect-libc "^1.0.3" - node-addon-api "^4.2.0" - prebuild-install "^7.0.0" - semver "^7.3.5" - simple-get "^4.0.0" + color "^4.2.3" + detect-libc "^2.0.1" + node-addon-api "^5.0.0" + prebuild-install "^7.1.0" + semver "^7.3.7" + simple-get "^4.0.1" tar-fs "^2.1.1" tunnel-agent "^0.6.0" @@ -14608,10 +14606,10 @@ simple-get@^3.0.3: once "^1.3.1" simple-concat "^1.0.0" -simple-get@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.0.tgz#73fa628278d21de83dadd5512d2cc1f4872bd675" - integrity sha512-ZalZGexYr3TA0SwySsr5HlgOOinS4Jsa8YB2GJ6lUNAazyAu4KG/VmzMTwAt2YVXzzVj8QmefmAonZIK2BSGcQ== +simple-get@^4.0.0, simple-get@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== dependencies: decompress-response "^6.0.0" once "^1.3.1"