Skip to content

Commit

Permalink
Merge branch 'release/1.12.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Apr 5, 2024
2 parents ab1a9a0 + 9c8a485 commit 4fe8cd6
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.12.5]

### Added

- Crash reporting for initialization errors

## [1.12.4]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumi",
"version": "1.12.4",
"version": "1.12.5",
"author": "Raphiiko",
"license": "MIT",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions src-core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr"
version = "1.12.4"
version = "1.12.5"
description = ""
authors = ["Raphiiko"]
license = "MIT"
Expand Down
19 changes: 9 additions & 10 deletions src-core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use tauri_plugin_log::{LogTarget, RotationStrategy};
fn main() {
tauri_plugin_deep_link::prepare("co.raphii.oyasumi.deeplink");
// Construct Oyasumi Tauri application
let app = tauri::Builder::default()
tauri::Builder::default()
.plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_fs_extra::init())
.plugin(configure_tauri_plugin_log())
Expand Down Expand Up @@ -74,15 +74,14 @@ fn main() {
.on_window_event(system_tray::handle_window_events())
.invoke_handler(configure_command_handlers())
.build(tauri::generate_context!())
.expect("An error occurred while running the application");
// Run OyasumiVR
app.run(|handler, event| match event {
tauri::RunEvent::Exit { .. } => {
handler.track_event("app_exited", None);
handler.flush_events_blocking();
}
_ => {}
})
.expect("An error occurred while running the application")
.run(|handler, event| match event {
tauri::RunEvent::Exit { .. } => {
handler.track_event("app_exited", None);
handler.flush_events_blocking();
}
_ => {}
})
}

async fn load_configs() {
Expand Down
6 changes: 3 additions & 3 deletions src-core/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "OyasumiVR",
"version": "1.12.4"
"version": "1.12.5"
},
"tauri": {
"allowlist": {
Expand Down Expand Up @@ -188,7 +188,7 @@
"center": true,
"theme": "Dark",
"transparent": true,
"userAgent": "OyasumiVR/1.12.4 (https://github.com/Raphiiko/OyasumiVR)"
"userAgent": "OyasumiVR/1.12.5 (https://github.com/Raphiiko/OyasumiVR)"
},
{
"width": 700,
Expand All @@ -200,7 +200,7 @@
"center": true,
"theme": "Dark",
"transparent": true,
"userAgent": "OyasumiVR/1.12.4 (https://github.com/Raphiiko/OyasumiVR)"
"userAgent": "OyasumiVR/1.12.5 (https://github.com/Raphiiko/OyasumiVR)"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src-elevated-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr-elevated-sidecar"
version = "1.12.4"
version = "1.12.5"
authors = ["Raphiiko"]
license = "MIT"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-overlay-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumivr-overlay-ui",
"version": "1.12.4",
"version": "1.12.5",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
2 changes: 1 addition & 1 deletion src-shared-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr-shared"
version = "1.12.4"
version = "1.12.5"
authors = ["Raphiiko"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-shared-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "src-shared-ts",
"description": "Shared typescript code for Oyasumi modules",
"scripts": {},
"version": "1.12.4",
"version": "1.12.5",
"author": "Raphiiko",
"license": "MIT",
"type": "module",
Expand Down
9 changes: 8 additions & 1 deletion src-ui/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ import { BigscreenBeyondLedAutomationService } from './services/hmd-specific-aut
import { BigscreenBeyondFanAutomationService } from './services/hmd-specific-automations/bigscreen-beyond-fan-automation.service';
import { BSBFanSpeedControlModalComponent } from './components/bsb-fan-speed-control-modal/bsb-fan-speed-control-modal.component';
import { DiscordService } from './services/discord.service';
import { trackEvent } from '@aptabase/tauri';
import { pTimeout } from './utils/promise-utils';

[
localeEN,
Expand Down Expand Up @@ -425,10 +427,15 @@ export class AppModule {
private async logInit<T>(action: string, promise: Promise<T>): Promise<T> {
if (FLAVOUR === 'DEV') console.log(`[Init] Running ${action}`);
try {
const result = await promise;
const result = await pTimeout<T>(
promise,
6000,
new Error(`Initialization function ${action} timed out.`)
);
if (FLAVOUR === 'DEV') info(`[Init] '${action}' ran successfully`);
return result;
} catch (e) {
trackEvent('app_init_error', { action, error: `${e}` });
error(`[Init] Running '${action}' failed: ` + e);
throw e;
}
Expand Down
12 changes: 12 additions & 0 deletions src-ui/app/utils/promise-utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export function pTimeout<T>(
promise: Promise<T>,
timeoutMs: number,
timeoutError = new Error('Promise timed out')
): Promise<T> {
const timeout = new Promise((_, reject) => {
setTimeout(() => {
reject(timeoutError);
}, timeoutMs);
});
return Promise.race([promise, timeout]) as Promise<T>;
}

0 comments on commit 4fe8cd6

Please sign in to comment.