Skip to content

Conversation

Copy link

Copilot AI commented Dec 19, 2025

The webapp crashes when the backend introduces new protobuf fields because fromJson strictly validates against the schema.

Changes

  • Created protobuf-utils.ts: Wraps fromJson with ignoreUnknownFields: true option
  • Updated 12 files: Changed all fromJson imports to use the new wrapper
// Before: crashes on unknown fields
import { fromJson } from "@bufbuild/protobuf";
const message = fromJson(MessageSchema, jsonData);

// After: ignores unknown fields
import { fromJson } from "./libs/protobuf-utils";
const message = fromJson(MessageSchema, jsonData);

This allows older webapp versions to work with newer backend versions that add fields, following standard protobuf forward compatibility patterns.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • buf.build
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

current webapp verifies all grpc schema fields, but when a new field is introduced, the front end will crash completely. please make a PR to let the webapp able to accept json schemas with new fields.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 19, 2025 02:09
Co-authored-by: Junyi-99 <14367694+Junyi-99@users.noreply.github.com>
Co-authored-by: Junyi-99 <14367694+Junyi-99@users.noreply.github.com>
Co-authored-by: Junyi-99 <14367694+Junyi-99@users.noreply.github.com>
Copilot AI changed the title [WIP] Update webapp to handle new JSON schema fields without crashing Add ignoreUnknownFields to protobuf JSON parsing Dec 19, 2025
Copilot AI requested a review from Junyi-99 December 19, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants