chore: improve openobserve maintenance path (#12508)

Summary:
- Add or tighten focused edge-case tests or type assertions in
web/src/main.ts, web/src/App.spec.ts related to TypeScript, frontend
tooling, test stability, build fixes; avoid docs-only changes and broad
refactors.
- Keep the change narrow so it is straightforward to review.

Notes:
- I kept this scoped to the relevant implementation and tests.

Co-authored-by: Kai Tanaka <275430420+quyentonndbs@users.noreply.github.com>
This commit is contained in:
quyentonndbs
2026-06-30 16:04:05 +00:00
committed by GitHub
co-authored by Kai Tanaka
parent 34646a9cfa
commit 908e6d720b
2 changed files with 26 additions and 5 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ describe('App.vue', () => {
let wrapper: VueWrapper;
let store: any;
let router: any;
let mockDispatch: any;
let mockPush: any;
let mockDispatch: ReturnType<typeof vi.fn>;
let mockPush: ReturnType<typeof vi.fn>;
beforeEach(() => {
// Reset mocks
+24 -3
View File
@@ -55,16 +55,37 @@ reoInit();
// app.use(SearchPlugin);
interface ConfigResponse {
data?: {
telemetry_enabled?: boolean;
commit_hash?: string;
rum?: {
enabled: boolean;
client_token: string;
application_id: string;
site: string;
service: string;
env: string;
version?: string;
organization_identifier: string;
insecure_http?: boolean;
api_version?: string;
};
};
}
const getConfig = async () => {
await configService.get_config().then((res: any) => {
await configService.get_config().then((res: ConfigResponse) => {
if (!res.data) return;
store.dispatch("setConfig", res.data);
config.enableAnalytics = res.data.telemetry_enabled.toString();
config.enableAnalytics = res.data.telemetry_enabled?.toString() ?? "false";
// Store initial commit hash for version checking
if (res.data.commit_hash) {
buildVersionChecker.setInitialVersion(res.data.commit_hash);
}
if (res.data.rum.enabled) {
if (res.data.rum?.enabled) {
const options = {
clientToken: res.data.rum.client_token,
applicationId: res.data.rum.application_id,