remove sourceVersion and minor cleanup

This commit is contained in:
Matt Hill
2024-07-29 22:42:17 -06:00
parent 1dd21f1f76
commit 290a15bbd9
6 changed files with 10 additions and 16 deletions

View File

@@ -3,7 +3,6 @@ import { T } from '@start9labs/start-sdk'
export type GetPackageReq = {
id: string
version: string | null
sourceVersion: null // @TODO what is this?
otherVersions: 'short'
}
export type GetPackageRes = T.GetPackageResponse & {
@@ -13,9 +12,9 @@ export type GetPackageRes = T.GetPackageResponse & {
export type GetPackagesReq = {
id: null
version: null
sourceVersion: null
otherVersions: 'short'
}
export type GetPackagesRes = {
[id: T.PackageId]: GetPackageRes
}

View File

@@ -58,9 +58,7 @@ export class InitService extends Observable<MappedProgress> {
}
}),
catchError(e => {
// @TODO Alex this toast is presenting when we navigate away from init page. It seems other websockets exhibit the same behavior, but we never noticed because the error were not being caught and presented in this manner. It seems odd that unsubscribing from a websocket subject would be treated as an error.
// this.errorService.handleError(e)
console.error(e)
return EMPTY
}),
)

View File

@@ -138,8 +138,8 @@ export class SideloadPage {
).getUint32(0, false)
await getPositions(start, end, file, positions, tocLength as any)
await this.getManifest(positions, file)
await this.getIcon(positions, file)
await this.getManifestV1(positions, file)
await this.getIconV1(positions, file)
}
async parseS9pkV2(file: File) {
@@ -148,7 +148,7 @@ export class SideloadPage {
this.toUpload.icon = await s9pk.icon()
}
async getManifest(positions: Positions, file: Blob) {
private async getManifestV1(positions: Positions, file: Blob) {
const data = await blobToBuffer(
file.slice(
Number(positions['manifest'][0]),
@@ -158,12 +158,11 @@ export class SideloadPage {
this.toUpload.manifest = await cbor.decode(data, true)
}
async getIcon(positions: Positions, file: Blob) {
const contentType = '' // @TODO
private async getIconV1(positions: Positions, file: Blob) {
const data = file.slice(
Number(positions['icon'][0]),
Number(positions['icon'][0]) + Number(positions['icon'][1]),
contentType,
'',
)
this.toUpload.icon = await blobToDataURL(data)
}

View File

@@ -38,7 +38,7 @@ export class LiveApiService extends ApiService {
@Inject(PATCH_CACHE) private readonly cache$: Observable<Dump<DataModel>>,
) {
super()
;(window as any).rpcClient = this
; (window as any).rpcClient = this
}
// for sideloading packages
@@ -321,7 +321,6 @@ export class LiveApiService extends ApiService {
const params: GetPackageReq = {
id,
version: versionRange,
sourceVersion: null,
otherVersions: 'short',
}
@@ -335,7 +334,6 @@ export class LiveApiService extends ApiService {
const params: GetPackagesReq = {
id: null,
version: null,
sourceVersion: null,
otherVersions: 'short',
}

View File

@@ -41,7 +41,7 @@ export class PatchDbSource extends Observable<Update<DataModel>[]> {
catchError((_, original$) => {
this.state.retrigger()
// @TODO this is returning right away, but we need to wait until state emits again from the retrigger() above.
// @TODO Alex this is returning right away and crashing the browser, but we need to wait until state emits again from the retrigger() above.
return this.state.pipe(
filter(current => current === 'running'),
take(1),

View File

@@ -111,7 +111,7 @@ export class StateService extends Observable<RR.ServerState | null> {
),
),
)
.subscribe() // @TODO shouldn't this be subscribed in app component with the others? Do we ever need to unsubscribe?
.subscribe() // @TODO Alex shouldn't this be subscribed in app component with the others? Do we ever need to unsubscribe?
constructor() {
super(subscriber => this.stream$.subscribe(subscriber))