Skip to content

Type delegates response and remove stray debug logs - #12

Open
epikalmit wants to merge 2 commits into
lightchain-protocol:mainfrom
epikalmit:chore/cleanup-graphql-api-types-and-logs
Open

epikalmit wants to merge 2 commits into
lightchain-protocol:mainfrom
epikalmit:chore/cleanup-graphql-api-types-and-logs

Conversation

@epikalmit

@epikalmit epikalmit commented Apr 27, 2026

Copy link
Copy Markdown

Summary

  • Add ApiDelegate alias re-exporting DelegateFieldsFragment in graphqlApi/types.ts, matching the existing ApiProposal/ApiVote pattern.
  • Use ApiDelegate to type the loadDelegates map callback in graphqlApi/index.ts, removing a stray any from the response shape.
  • In formatExecution and formatSimulation parse fallbacks, bind the caught error and forward it to console.error so failures are actually diagnosable (was console.log with no error context).
  • Remove the leftover debug console.log("Proposal created with ID:", …) from the onSuccess callback in app/proposal/create/page.tsx.

Note: the parse-fallback log calls move from console.log to console.error. The catch path is still a documented graceful fallback (returns []), but parse failures on indexer payloads are unexpected and should surface — flagging in case any external log filter treats error differently.

Test plan (for reviewer)

  • npm run lint passes
  • npm run build / Vercel preview succeeds
  • Delegates list still renders correctly (loadDelegates path)
  • Creating a proposal still navigates to / on success

I was unable to run lint locally — the repo .npmrc requires a NPM_FONTAWESOME_TOKEN I don't have. Happy to iterate if CI/Vercel preview catches anything.

- Add ApiDelegate alias re-exporting DelegateFieldsFragment, mirroring
  the existing ApiProposal/ApiVote pattern in graphqlApi/types.ts
- Use ApiDelegate to type the loadDelegates map callback (drops a stray
  `any` from the response shape)
- Convert silent-catch console.log calls in formatExecution and
  formatSimulation to console.error so parse failures surface as errors
- Remove leftover debug console.log in the proposal-create onSuccess
  callback
@vercel

vercel Bot commented Apr 27, 2026

Copy link
Copy Markdown

@epikalmit is attempting to deploy a commit to the Lightchain AI Team on Vercel.

A member of the Team first needs to authorize it.

Without the error object, the call carried error severity but no
diagnostic value. Bind the caught value so failures are actionable.
@epikalmit epikalmit changed the title chore(graphqlApi): type delegates response and tidy logs Type delegates response and remove stray debug logs Apr 27, 2026
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.

1 participant