Skip to content

Fix vote registration reliability, remove PoW bottleneck, add GunDB write timeout, reload on content navigation, and dynamic API URL#3

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/exclusive-chameleon
Draft

Fix vote registration reliability, remove PoW bottleneck, add GunDB write timeout, reload on content navigation, and dynamic API URL#3
Copilot wants to merge 4 commits into
masterfrom
copilot/exclusive-chameleon

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

  • Identify root cause: relay-server /api/vote-authorize adds to voteRegistry during CHECK phase, blocking retries if vote fails
  • Server: change /api/vote-authorize to check-only (don't add to registry)
  • Server: add /api/vote-confirm endpoint to register after vote succeeds
  • Client: add AuditService.confirmVote() method
  • Client: call confirmVote() after vote is confirmed on-chain in PollDetailPage.vue
  • Build passes, code review clean, CodeQL clean
Original prompt

poll and votes do not register sometimes also posts shoud load faster an instead of switching actually reload the page edit pollpage.vue realy-server gun everything u need

[Chronological Review: The conversation began with system instructions defining the assistant context and verbosity, followed by a developer instruction requiring a comprehensive handoff summary format with special emphasis on recent commands/tools. The user then provided the actual work request with a timestamp and the task: “/delegate poll and votes do not register sometimes also posts shoud load faster an instead of switching actually reload the page edit pollpage.vue realy-server gun everything u need”. Immediately after, before any implementation, exploration, or tool usage occurred, the user asked for a summary of the conversation history so far and explicitly said not to call any tools. No code inspection, editing, debugging, or execution happened before summarization.]

[Intent Mapping: Explicit requests were: (1) fix delegate poll/vote registration reliability issues, (2) make posts load faster, (3) make the page reload instead of switching, (4) edit “pollpage.vue”, and (5) use “realy-server gun everything u need” as available project context/tools. The follow-up explicit request was to summarize the conversation history so far using the enhanced format, with emphasis on recent agent commands and tool results. Implicitly, the user expects work on a codebase involving a poll page, server behavior, and page navigation/performance. However, no implementation work started.]

[Technical Inventory: Mentioned technical elements include “pollpage.vue” (likely a Vue component), “poll and votes” registration logic, “posts” loading performance, and “reload the page instead of switching” (likely routing/navigation behavior). The environment reminder stated no SQL tables currently exist and default tables would be auto-created on first SQL tool use, but no SQL tool was used. No frameworks, packages, APIs, commands, or runtime details were actually inspected or confirmed during the conversation.]

[Code Archaeology: No files were opened, read, modified, or discussed beyond the user naming “pollpage.vue”. No functions, classes, variables, or code paths were inspected. No patches were applied. No repository structure was explored.]

[Progress Assessment: Completed: only intake of the user’s requested goals and the later request to summarize. Pending: all actual development work—diagnosing why polls/votes sometimes do not register, optimizing post loading speed, changing behavior from client-side switching to full page reload, and editing pollpage.vue. No testing, validation, or debugging has been performed.]

[Context Validation: Critical continuation context is small but clear: the main work request is to edit pollpage.vue to address intermittent poll/vote registration issues, improve post loading speed, and replace page switching with actual reload behavior. There were no tool calls, no code findings, and no implementation state to preserve beyond the exact user request. The summary must note that the token budget was not exceeded due to extensive work; instead, summarization was directly requested almost immediately.]

[Recent Commands Analysis: There were no agent commands executed and no tool calls made. Therefore there are no command outputs or tool results to report. The immediate pre-summarization state was idle after receiving the user’s initial development request; the assistant had not yet started repository inspection or edits. The triggering context for summarization was the user’s direct instruction to summarize the conversation so far and explicitly avoid any tool usage.]

1. Conversation Overview: - Primary Objectives: - User requested: “/delegate poll and votes do not register sometimes also posts shoud load faster an instead of switching actually reload the page edit pollpage.vue realy-server gun everything u need” - Then user requested a summary only, with emphasis on recent commands/tool results, and explicitly said: “Do NOT call any tools.” - Session Context: - The session consisted of setup instructions, then the user’s development task, then an immediate request to summarize before any work began. - User Intent Evolution: - Initial intent: have the assistant fix a poll/voting reliability issue, improve post loading speed, and change navigation behavior by editing `pollpage.vue`. - Follow-up intent: pause implementation and produce a structured handoff summary of the conversation to date.
  1. Technical Foundation:
    • Vue component:
      • pollpage.vue was explicitly named as the target file to edit.
    • Poll/vote system:
      • User reported that “poll and votes do not register sometimes,” implying intermittent client/server state or submission issues.
    • Performance concern:
      • User said “posts shoud load faster,” indicating a need for fronte...

Created from Copilot CLI via the copilot delegate command.

…t, dynamic API URL

Agent-Logs-Url: https://github.com/theEndless11/decentralised/sessions/48eb5e0b-635d-45d1-a3d7-2c1a04e54463

Co-authored-by: thegoodduck <163307030+thegoodduck@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues with poll and votes registration Fix vote registration reliability, add GunDB write timeout, reload on content navigation, and dynamic API URL Apr 4, 2026
Copilot AI requested a review from thegoodduck April 4, 2026 01:11
@thegoodduck
Copy link
Copy Markdown
Collaborator

hey @copilot still doesnt vote with no logs

…and fetch timeout

Agent-Logs-Url: https://github.com/theEndless11/decentralised/sessions/4d410c8d-a0a8-4177-a9f7-a4c814fa4ff0

Co-authored-by: thegoodduck <163307030+thegoodduck@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 4, 2026

hey @copilot still doesnt vote with no logs

Found the root cause: AuditService.authorizeVote() was calling IntegrityService.seal() with difficulty-18 PoW (262K SHA-256 hashes) before every vote. This CPU-intensive computation could hang for 5-30+ seconds — and the relay server at /api/vote-authorize never even validates the seal. It just reads pollId and deviceId.

Fixed in 7123e5c:

  • Removed the PoW bottleneck from authorizeVote() — sends raw JSON directly instead of sealing with difficulty-18 hashcash
  • Added 8s fetch timeout via AbortController so the vote can't hang on a slow server
  • Added step-by-step [Vote] logging at every stage of the vote flow — if it still fails, open browser DevTools console and you'll see exactly which step gets stuck (e.g. [Vote] Step 3: Authorizing with backend...)
  • Also removed unnecessary IntegrityService.seal() from logReceipt()

The initial bundle also got ~2KB smaller since the PoW/integrity code is no longer imported.

Copilot AI changed the title Fix vote registration reliability, add GunDB write timeout, reload on content navigation, and dynamic API URL Fix vote registration reliability, remove PoW bottleneck, add GunDB write timeout, reload on content navigation, and dynamic API URL Apr 4, 2026
…isters after success

Agent-Logs-Url: https://github.com/theEndless11/decentralised/sessions/787ae6ec-d285-41e1-8d25-0c833aca58a8

Co-authored-by: thegoodduck <163307030+thegoodduck@users.noreply.github.com>
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