Skip to content

Commit 79f593c

Browse files
committed
Fix CI failures
1 parent f1501ec commit 79f593c

4 files changed

Lines changed: 27 additions & 30 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/src-tauri/src/menu/mod.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,19 @@ fn set_macos_menu_icons_inner() {
481481
],
482482
"View" => {
483483
// Also apply icons to the "Sort by" submenu items
484-
apply_sf_symbols_to_nested_submenu(&submenu, "Sort by", &[
485-
("Name", "textformat.alt"),
486-
("Extension", "character.textbox"),
487-
("Size", "ruler"),
488-
("Date modified", "clock"),
489-
("Date created", "calendar"),
490-
("Ascending", "chevron.up"),
491-
("Descending", "chevron.down"),
492-
]);
484+
apply_sf_symbols_to_nested_submenu(
485+
&submenu,
486+
"Sort by",
487+
&[
488+
("Name", "textformat.alt"),
489+
("Extension", "character.textbox"),
490+
("Size", "ruler"),
491+
("Date modified", "clock"),
492+
("Date created", "calendar"),
493+
("Ascending", "chevron.up"),
494+
("Descending", "chevron.down"),
495+
],
496+
);
493497

494498
&[
495499
("Switch pane", "rectangle.2.swap"),
@@ -519,10 +523,7 @@ fn set_macos_menu_icons_inner() {
519523

520524
/// Applies SF Symbol icons to menu items in a submenu, matching by title.
521525
#[cfg(target_os = "macos")]
522-
fn apply_sf_symbols_to_submenu(
523-
submenu: &objc2_app_kit::NSMenu,
524-
mappings: &[(&str, &str)],
525-
) {
526+
fn apply_sf_symbols_to_submenu(submenu: &objc2_app_kit::NSMenu, mappings: &[(&str, &str)]) {
526527
let item_count = submenu.numberOfItems();
527528
for j in 0..item_count {
528529
let Some(item) = submenu.itemAtIndex(j) else {
@@ -543,11 +544,7 @@ fn apply_sf_symbols_to_submenu(
543544

544545
/// Applies SF Symbol icons to items inside a nested submenu (e.g. "Sort by" inside "View").
545546
#[cfg(target_os = "macos")]
546-
fn apply_sf_symbols_to_nested_submenu(
547-
parent: &objc2_app_kit::NSMenu,
548-
submenu_title: &str,
549-
mappings: &[(&str, &str)],
550-
) {
547+
fn apply_sf_symbols_to_nested_submenu(parent: &objc2_app_kit::NSMenu, submenu_title: &str, mappings: &[(&str, &str)]) {
551548
let count = parent.numberOfItems();
552549
for i in 0..count {
553550
let Some(item) = parent.itemAtIndex(i) else {

apps/license-server/src/license.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ describe('generateLicenseKey', () => {
7272
expect(parts).toHaveLength(2)
7373

7474
// Both parts should be base64 encoded
75-
expect(() => atob(parts[0])).not.toThrow()
76-
expect(() => atob(parts[1])).not.toThrow()
75+
expect(() => Buffer.from(parts[0], 'base64')).not.toThrow()
76+
expect(() => Buffer.from(parts[1], 'base64')).not.toThrow()
7777
})
7878

7979
it('embeds license data in the payload', async () => {
@@ -89,7 +89,7 @@ describe('generateLicenseKey', () => {
8989

9090
const key = await generateLicenseKey(licenseData, privateKeyHex)
9191
const [payloadBase64] = key.split('.')
92-
const payloadJson = atob(payloadBase64)
92+
const payloadJson = Buffer.from(payloadBase64, 'base64').toString('utf-8')
9393
const decoded = JSON.parse(payloadJson) as LicenseData
9494

9595
expect(decoded.email).toBe(licenseData.email)
@@ -113,8 +113,8 @@ describe('generateLicenseKey', () => {
113113
const [payloadBase64, signatureBase64] = key.split('.')
114114

115115
// Decode payload and signature
116-
const payloadBytes = Uint8Array.from(atob(payloadBase64), (c) => c.charCodeAt(0))
117-
const signatureBytes = Uint8Array.from(atob(signatureBase64), (c) => c.charCodeAt(0))
116+
const payloadBytes = new Uint8Array(Buffer.from(payloadBase64, 'base64'))
117+
const signatureBytes = new Uint8Array(Buffer.from(signatureBase64, 'base64'))
118118

119119
// Verify signature
120120
const isValid = await ed.verifyAsync(signatureBytes, payloadBytes, publicKey)
@@ -145,7 +145,7 @@ describe('generateLicenseKey', () => {
145145
}
146146
const tamperedPayload = JSON.stringify(tamperedData)
147147
const tamperedPayloadBytes = new TextEncoder().encode(tamperedPayload)
148-
const signatureBytes = Uint8Array.from(atob(signatureBase64), (c) => c.charCodeAt(0))
148+
const signatureBytes = new Uint8Array(Buffer.from(signatureBase64, 'base64'))
149149

150150
// Signature should NOT verify for tampered payload
151151
const isValid = await ed.verifyAsync(signatureBytes, tamperedPayloadBytes, publicKey)
@@ -166,7 +166,7 @@ describe('generateLicenseKey', () => {
166166

167167
const key = await generateLicenseKey(licenseData, privateKeyHex)
168168
const [payloadBase64] = key.split('.')
169-
const payloadJson = atob(payloadBase64)
169+
const payloadJson = Buffer.from(payloadBase64, 'base64').toString('utf-8')
170170
const decoded = JSON.parse(payloadJson) as LicenseData
171171

172172
expect(decoded.organizationName).toBe('Acme Corporation')
@@ -188,7 +188,7 @@ describe('generateLicenseKey', () => {
188188

189189
const key = await generateLicenseKey(licenseData, privateKeyHex)
190190
const [payloadBase64] = key.split('.')
191-
const payloadJson = atob(payloadBase64)
191+
const payloadJson = Buffer.from(payloadBase64, 'base64').toString('utf-8')
192192
const decoded = JSON.parse(payloadJson) as LicenseData
193193

194194
expect(decoded.organizationName).toBeUndefined()
@@ -218,7 +218,7 @@ describe('generateLicenseKey', () => {
218218
}
219219
const tamperedPayload = JSON.stringify(tamperedData)
220220
const tamperedPayloadBytes = new TextEncoder().encode(tamperedPayload)
221-
const signatureBytes = Uint8Array.from(atob(signatureBase64), (c) => c.charCodeAt(0))
221+
const signatureBytes = new Uint8Array(Buffer.from(signatureBase64, 'base64'))
222222

223223
// Signature should NOT verify for tampered org name
224224
const isValid = await ed.verifyAsync(signatureBytes, tamperedPayloadBytes, publicKey)

apps/license-server/src/license.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ function hexToBytes(hex: string): Uint8Array {
7373
}
7474

7575
function bytesToBase64(bytes: Uint8Array): string {
76-
return btoa(String.fromCharCode(...bytes))
76+
return Buffer.from(bytes).toString('base64')
7777
}

0 commit comments

Comments
 (0)