Merge upstream v0.3.5: types, protocol, session handling#9
Closed
Merge upstream v0.3.5: types, protocol, session handling#9
Conversation
| resolveLaunchAppId(input: ResolveLaunchIdRequest): Promise<string | null>; | ||
| createSession(input: SessionCreateRequest): Promise<SessionInfo>; | ||
| pollSession(input: SessionPollRequest): Promise<SessionInfo>; | ||
| reportSessionAd(input: SessionAdReportRequest): Promise<SessionInfo>; |
There was a problem hiding this comment.
[🟡 Medium]
OpenNowApi declares reportSessionAd as returning a SessionInfo, but the new main/preload implementations return no payload (Promise<void>/null). This creates a false contract at the shared boundary and can produce runtime undefined/null access bugs when callers use the declared return value. Align the interface with actual behavior (or return a real SessionInfo consistently) so type-checking reflects runtime behavior.
// opennow-stable/src/shared/gfn.ts
createSession(input: SessionCreateRequest): Promise<SessionInfo>;
pollSession(input: SessionPollRequest): Promise<SessionInfo>;
reportSessionAd(input: SessionAdReportRequest): Promise<SessionInfo>;
stopSession(input: SessionStopRequest): Promise<void>;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR syncs the Android fork with upstream OpenNOW v0.3.5, bringing in new shared types, GFN protocol improvements, ad handling, screenshot/recording APIs, and session management enhancements. All changes maintain Android compatibility via appropriate shims for Node.js-only modules.
Shared Types & IPC
GameLanguage,KeyboardLayout,AspectRatio,RuntimePlatformtypes tosrc/shared/gfn.tsSessionAdAction,SessionAdInfo,SessionAdState,SessionAdReportRequestScreenshotSaveRequest,RecordingEntry,PrintedWasteZone,ThankYouDataResultsrc/shared/sessionError.tswithSessionErrorInfointerface and serialization functionsSettingsinterface with new fields while preservingtouchGamepadLayoutMain Process GFN Logic
src/main/gfn/types.ts: Added ad-related session fields,negotiatedStreamProfile,sessionRequestDatasrc/main/gfn/errorCodes.ts: Updated error messages, movedSessionErrorInfoto sharedsrc/main/gfn/auth.ts: AddedgravatarUrl()with process guard for Android compatibilitysrc/main/gfn/signaling.ts: AddedconnectionGenerationcounter, improved URL parsing, keyframe request supportsrc/main/gfn/cloudmatch.ts: Ported all upstream changes including ad handling, DNS resolution, ICE server normalization; madetoSessionInfo()asyncsrc/main/gfn/games.ts: Added feature labels and genres extraction (caching stubbed for Android)src/main/settings.ts: Added all new settings with migration/normalization logicPreload & Renderer Integration
src/preload/index.ts: Added 25+ new API methods withinvokeSessionChannelwrapper for session error unwrappingsrc/renderer/src/platform/dnsShim.ts(new): Browser shim fornode:dnsto enable cloudmatch.ts in WebViewsrc/renderer/src/App.tsx: FixedStreamSettingsobject to include all required new fieldssrc/renderer/src/platform/api.ts: Maintained Android path with stub implementations for Electron-only featuresBuild Configuration
electron.vite.config.ts: Addednode:dnsalias pointing to browser shimtsconfig.json&tsconfig.node.json: Added@main/*path aliases andnodetypessrc/shared/deviceHeaders.ts: Addedprocessdeclare for browser context safety