Skip to content

Commit c495668

Browse files
committed
Merge branch 'main' of github.com:HyperPlay-Gaming/hyperplay-desktop-client into tech/sust_ipc_refactor
2 parents dbb001b + 4b9bfaf commit c495668

File tree

7 files changed

+28
-229
lines changed

7 files changed

+28
-229
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperplay",
3-
"version": "0.24.0",
3+
"version": "0.23.3",
44
"private": true,
55
"main": "build/main/main.js",
66
"homepage": "./",

public/locales/fi/translation.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"accessibility": {
3-
"actions_font_family_no_default": "Toimintojen fonttiperhe (oletus): ",
3+
"actions_font_family_no_default": "Toimintojen kirjaisinperhe (oletus): ",
44
"all_tiles_in_color": "Näytä kaikki pelin laatat värillisinä",
5-
"content_font_family_no_default": "Sisältöfonttiperhe (oletus): ",
5+
"content_font_family_no_default": "Sisältökirjaisinperhe (oletus): ",
66
"fonts": "Fontit",
77
"title": "Esteettömyys",
88
"zoom": "Zoom"

public/locales/ru/translation.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,10 @@
696696
"achievements": "Достижения",
697697
"store": "Интернет-магазин",
698698
"library": "Библиотека",
699-
"downloadManager": "Скачать менеджер"
699+
"downloadManager": "Скачать менеджер",
700+
"docs": "Документы",
701+
"quests": "Квесты",
702+
"settings": "Настройки"
700703
},
701704
"status": {
702705
"installing": "Установка",
@@ -1028,7 +1031,8 @@
10281031
},
10291032
"viewAllQuests": {
10301033
"title": "Просмотр всех квестов"
1031-
}
1034+
},
1035+
"search": "Поиск"
10321036
},
10331037
"ALL": "Все",
10341038
"analytics": "Аналитика",

src/backend/metrics/types.ts

-25
Original file line numberDiff line numberDiff line change
@@ -228,29 +228,6 @@ export interface PatchingFailed {
228228
sensitiveProperties?: never
229229
}
230230

231-
export interface PatchingAborted {
232-
event: 'Patching Aborted'
233-
properties: {
234-
game_name: string
235-
game_title: string
236-
platform: ReturnType<typeof getPlatformName>
237-
platform_arch: InstallPlatform
238-
}
239-
sensitiveProperties?: never
240-
}
241-
242-
export interface PatchingCleanupFailed {
243-
event: 'Patching Cleanup Failed'
244-
properties: {
245-
game_name: string
246-
error: string
247-
game_title: string
248-
platform?: ReturnType<typeof getPlatformName>
249-
platform_arch?: InstallPlatform
250-
}
251-
sensitiveProperties?: never
252-
}
253-
254231
export interface PatchingTooSlow {
255232
event: 'Patching Too Slow'
256233
properties: {
@@ -498,8 +475,6 @@ export type PossibleMetricPayloads =
498475
| PatchingStarted
499476
| PatchingSuccess
500477
| PatchingFailed
501-
| PatchingAborted
502-
| PatchingCleanupFailed
503478
| PatchingTooSlow
504479
| AccountDropdownPortfolioClicked
505480

src/backend/storeManagers/hyperplay/games.ts

+16-86
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ import {
6565
handleArchAndPlatform,
6666
handlePlatformReversed,
6767
runModPatcher,
68-
sanitizeVersion,
69-
safeRemoveDirectory
68+
sanitizeVersion
7069
} from './utils'
7170
import { getSettings as getSettingsSideload } from 'backend/storeManagers/sideload/games'
7271
import {
@@ -424,11 +423,11 @@ const findExecutables = async (folderPath: string): Promise<string[]> => {
424423
return executables
425424
}
426425

427-
export async function cleanUpDownload(appName: string, directory: string) {
426+
export function cleanUpDownload(appName: string, directory: string) {
428427
inProgressDownloadsMap.delete(appName)
429428
inProgressExtractionsMap.delete(appName)
430429
deleteAbortController(appName)
431-
await safeRemoveDirectory(directory)
430+
rmSync(directory, { recursive: true, force: true })
432431
}
433432

434433
function getDownloadUrl(platformInfo: PlatformConfig, appName: string) {
@@ -524,9 +523,9 @@ async function downloadGame(
524523
res()
525524
}
526525

527-
async function onCancel() {
526+
function onCancel() {
528527
try {
529-
await cleanUpDownload(appName, directory)
528+
cleanUpDownload(appName, directory)
530529
} catch (err) {
531530
rej(err)
532531
}
@@ -1182,7 +1181,7 @@ export async function extract(
11821181
body: `Installed`
11831182
})
11841183

1185-
await cleanUpDownload(appName, directory)
1184+
cleanUpDownload(appName, directory)
11861185

11871186
sendFrontendMessage('refreshLibrary', 'hyperplay')
11881187

@@ -1191,21 +1190,21 @@ export async function extract(
11911190
})
11921191
}
11931192
)
1194-
extractService.once('error', async (error: Error) => {
1193+
extractService.once('error', (error: Error) => {
11951194
logError(`Extracting Error ${error.message}`, LogPrefix.HyperPlay)
11961195

11971196
cancelQueueExtraction()
11981197
callAbortController(appName)
11991198

1200-
await cleanUpDownload(appName, directory)
1199+
cleanUpDownload(appName, directory)
12011200

12021201
sendFrontendMessage('refreshLibrary', 'hyperplay')
12031202

12041203
resolve({
12051204
status: 'error'
12061205
})
12071206
})
1208-
extractService.once('canceled', async () => {
1207+
extractService.once('canceled', () => {
12091208
logInfo(
12101209
`Canceled Extracting: Cancellation completed on ${appName} - Destination ${destinationPath}`,
12111210
LogPrefix.HyperPlay
@@ -1243,7 +1242,7 @@ export async function extract(
12431242
body: 'Installation Stopped'
12441243
})
12451244

1246-
await cleanUpDownload(appName, directory)
1245+
cleanUpDownload(appName, directory)
12471246

12481247
sendFrontendMessage('refreshLibrary', 'hyperplay')
12491248

@@ -1915,18 +1914,13 @@ async function applyPatching(
19151914

19161915
if (signal.aborted) {
19171916
logInfo(`Patching ${appName} aborted`, LogPrefix.HyperPlay)
1918-
await safeRemoveDirectory(datastoreDir, {
1919-
sizeThresholdMB: blockSize * totalBlocks
1920-
})
1921-
aborted = true
1917+
rmSync(datastoreDir, { recursive: true })
19221918
return { status: 'abort' }
19231919
}
19241920

1925-
signal.onabort = async () => {
1921+
signal.onabort = () => {
19261922
aborted = true
1927-
await safeRemoveDirectory(datastoreDir, {
1928-
sizeThresholdMB: blockSize * totalBlocks
1929-
})
1923+
rmSync(datastoreDir, { recursive: true })
19301924
return { status: 'abort' }
19311925
}
19321926

@@ -2011,36 +2005,7 @@ async function applyPatching(
20112005
}
20122006
// need this to cover 100% of abort cases
20132007
if (aborted) {
2014-
try {
2015-
await safeRemoveDirectory(datastoreDir, {
2016-
sizeThresholdMB: blockSize * totalBlocks
2017-
})
2018-
} catch (cleanupError) {
2019-
trackEvent({
2020-
event: 'Patching Cleanup Failed',
2021-
properties: {
2022-
error: `${cleanupError}`,
2023-
game_name: gameInfo.app_name,
2024-
game_title: gameInfo.title,
2025-
platform: getPlatformName(platform),
2026-
platform_arch: platform
2027-
}
2028-
})
2029-
2030-
logWarning(
2031-
`Patching aborted and cleanup failed: ${cleanupError}`,
2032-
LogPrefix.HyperPlay
2033-
)
2034-
}
2035-
trackEvent({
2036-
event: 'Patching Aborted',
2037-
properties: {
2038-
game_name: gameInfo.app_name,
2039-
game_title: gameInfo.title,
2040-
platform: getPlatformName(platform),
2041-
platform_arch: platform
2042-
}
2043-
})
2008+
rmSync(datastoreDir, { recursive: true })
20442009
return { status: 'abort' }
20452010
}
20462011

@@ -2055,27 +2020,8 @@ async function applyPatching(
20552020
})
20562021

20572022
logInfo(`Patching ${appName} completed`, LogPrefix.HyperPlay)
2058-
try {
2059-
await safeRemoveDirectory(datastoreDir, {
2060-
sizeThresholdMB: blockSize * totalBlocks
2061-
})
2062-
} catch (cleanupError) {
2063-
trackEvent({
2064-
event: 'Patching Cleanup Failed',
2065-
properties: {
2066-
error: `${cleanupError}`,
2067-
game_name: gameInfo.app_name,
2068-
game_title: gameInfo.title,
2069-
platform: getPlatformName(platform),
2070-
platform_arch: platform
2071-
}
2072-
})
2023+
rmSync(datastoreDir, { recursive: true })
20732024

2074-
logWarning(
2075-
`Patching succeeded but cleanup failed: ${cleanupError}`,
2076-
LogPrefix.HyperPlay
2077-
)
2078-
}
20792025
return { status: 'done' }
20802026
} catch (error) {
20812027
if (error instanceof PatchingError) {
@@ -2115,23 +2061,7 @@ async function applyPatching(
21152061

21162062
// errors can be thrown before datastore dir created. rmSync on nonexistent dir blocks indefinitely
21172063
if (existsSync(datastoreDir)) {
2118-
try {
2119-
await safeRemoveDirectory(datastoreDir)
2120-
} catch (cleanupError) {
2121-
trackEvent({
2122-
event: 'Patching Cleanup Failed',
2123-
properties: {
2124-
error: `${cleanupError}`,
2125-
game_name: gameInfo.app_name,
2126-
game_title: gameInfo.title
2127-
}
2128-
})
2129-
2130-
logWarning(
2131-
`Patching failed and cleanup failed: ${cleanupError}`,
2132-
LogPrefix.HyperPlay
2133-
)
2134-
}
2064+
rmSync(datastoreDir, { recursive: true })
21352065
}
21362066

21372067
return { status: 'error', error: `Error while patching ${error}` }

0 commit comments

Comments
 (0)