mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
Tea cli version tracking (#608)
* bump 0.2.7 * #595 track tea version in sentry * #595 add teaVersion to sesssion * bump v0.2.13 --------- Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
parent
34cd8324ea
commit
24ff5f23ee
6 changed files with 11 additions and 6 deletions
|
@ -14,7 +14,7 @@ import initializePushNotification, {
|
||||||
syncPackageTopicSubscriptions
|
syncPackageTopicSubscriptions
|
||||||
} from "./libs/push-notification";
|
} from "./libs/push-notification";
|
||||||
|
|
||||||
import init from "./libs/initialize";
|
import init, { initializeTeaCli } from "./libs/initialize";
|
||||||
import { readSessionData } from "./libs/auth";
|
import { readSessionData } from "./libs/auth";
|
||||||
|
|
||||||
import { isDev } from "./libs/auto-updater";
|
import { isDev } from "./libs/auto-updater";
|
||||||
|
@ -38,10 +38,11 @@ if (app.isPackaged) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Sentry.configureScope(async (scope) => {
|
Sentry.configureScope(async (scope) => {
|
||||||
const session = await readSessionData();
|
const [session, cliVersion] = await Promise.all([readSessionData(), initializeTeaCli()]);
|
||||||
scope.setUser({
|
scope.setUser({
|
||||||
id: session.device_id, // device_id this should exist in our pg db: developer_id is to many device_id
|
id: session.device_id, // device_id this should exist in our pg db: developer_id is to many device_id
|
||||||
username: session?.user?.login || "" // github username or handler
|
username: session?.user?.login || "", // github username or handler
|
||||||
|
tea: cliVersion
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
setSentryLogging(Sentry);
|
setSentryLogging(Sentry);
|
||||||
|
|
|
@ -18,6 +18,7 @@ export interface Session {
|
||||||
key?: string;
|
key?: string;
|
||||||
user?: any;
|
user?: any;
|
||||||
locale?: string;
|
locale?: string;
|
||||||
|
teaVersion?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
let sessionMemory: Session = { device_id: "", locale: "en" };
|
let sessionMemory: Session = { device_id: "", locale: "en" };
|
||||||
|
|
|
@ -40,7 +40,8 @@ export default function initializeHandlers({ notifyMainWindow }: HandlerOptions)
|
||||||
ipcMain.handle("get-session", async () => {
|
ipcMain.handle("get-session", async () => {
|
||||||
try {
|
try {
|
||||||
log.info("getting session");
|
log.info("getting session");
|
||||||
const session = await readSessionData();
|
const [session, cliVersion] = await Promise.all([readSessionData(), initializeTeaCli()]);
|
||||||
|
session.teaVersion = cliVersion;
|
||||||
log.debug(session ? "found session data" : "no session data found");
|
log.debug(session ? "found session data" : "no session data found");
|
||||||
return session;
|
return session;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tea",
|
"name": "tea",
|
||||||
"version": "0.2.12",
|
"version": "0.2.13",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "tea gui app",
|
"description": "tea gui app",
|
||||||
"author": "tea.xyz",
|
"author": "tea.xyz",
|
||||||
|
|
|
@ -15,7 +15,8 @@ export async function initSentry(session?: Session) {
|
||||||
Sentry.configureScope(async (scope) => {
|
Sentry.configureScope(async (scope) => {
|
||||||
scope.setUser({
|
scope.setUser({
|
||||||
id: session.device_id, // device_id this should exist in our pg db: developer_id is to many device_id
|
id: session.device_id, // device_id this should exist in our pg db: developer_id is to many device_id
|
||||||
username: session?.user?.login || "" // github username or handler
|
username: session?.user?.login || "", // github username or handler
|
||||||
|
tea: session?.teaVersion || "unknown"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ export interface Session {
|
||||||
key?: string;
|
key?: string;
|
||||||
user?: Developer;
|
user?: Developer;
|
||||||
locale?: string;
|
locale?: string;
|
||||||
|
teaVersion?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum SideMenuOptions {
|
export enum SideMenuOptions {
|
||||||
|
|
Loading…
Reference in a new issue