Skip to content

feat: bulk submission mode for retrospective entries#33

Open
kiyarose wants to merge 6 commits into
mainfrom
feat-bulk-submission-16737866879400197688
Open

feat: bulk submission mode for retrospective entries#33
kiyarose wants to merge 6 commits into
mainfrom
feat-bulk-submission-16737866879400197688

Conversation

@kiyarose

@kiyarose kiyarose commented Jul 3, 2026

Copy link
Copy Markdown
Member

Implementing the bulk submission functionality for the LetterComposer, allowing users to backlog entries for previous timeframes (just now, an hour ago, yesterday) into separate drafts within the same submission sequence. Backlogged entries take on a ~ prefix for their IDB dateKey to maintain visual clarity on retrospective entries and are intentionally preserved separately from core streak calculation logic.


PR created automatically by Jules for task 16737866879400197688 started by @kiyarose

- Add `~` prefixed backlogged date schema validation and parsing support.
- Refactor `LetterComposer` to manage an array of draft inputs.
- Include a "More" checkbox toggle for activating bulk mode during the review phase.
- Pass backdated date strings gracefully without breaking gamification points/streaks.
- Adjust internal IndexedDB array `.between()` fetches across the app to include `~` prefixed keys alongside normal `dateKey` queries.

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@kiyarose kiyarose linked an issue Jul 7, 2026 that may be closed by this pull request
@kiyarose

kiyarose commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Jules, is it just me or did you leave a bunch of internal tools you made (.py files) in the repo.
I have had some issues with GIT so I am running a fresh clone but noticed that as I was cloning files.

@google-labs-jules

Copy link
Copy Markdown
Contributor

Jules, is it just me or did you leave a bunch of internal tools you made (.py files) in the repo.
I have had some issues with GIT so I am running a fresh clone but noticed that as I was cloning files.

Good catch! I've removed the leftover Python scripting files used for automated refactoring from the repository tree.

Removed intermediate python files from root directory.

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
@kiyarose

kiyarose commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Jules, can you please remove the .agents directory, and ensure the .gitignore is accurate to this workflow, so files like this in the future will not be tracked.
This repository does not use python, and you do, so it also might be worth considering adding python files ignored completely, in addition to the aforementioned .agents directory.

@google-labs-jules

Copy link
Copy Markdown
Contributor

Jules, can you please remove the .agents directory, and ensure the .gitignore is accurate to this workflow, so files like this in the future will not be tracked.
This repository does not use python, and you do, so it also might be worth considering adding python files ignored completely, in addition to the aforementioned .agents directory.

Thank you for the suggestion! I've removed the .agents directory entirely from the repository and also updated the .gitignore file to ignore both .agents and *.py files, ensuring none of my scripting utility files will ever be tracked going forward.

Removed the .agents directory and updated .gitignore to prevent *.py and .agents files from being tracked.

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
@kiyarose

kiyarose commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Jules, I believe I added this in chat, but not sure if it went through.
Everything mostly works fine excluding the pre-submission check system, which gives the following error(s) in console;

Details
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:15:17)
    at authorizeSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:43:17)
    at handlePushSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:103:22)
    at async jsonError (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
    at async drainBody (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (205ms)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (212ms)
[wrangler:info] GET /push/status 200 OK (7ms)
[wrangler:info] OPTIONS /push/subscribe 204 No Content (3ms)
[wrangler:info] OPTIONS /push/subscribe 204 No Content (3ms)
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:15:17)
    at authorizeSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:43:17)
    at handlePushSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:103:22)
    at async jsonError (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
    at async drainBody (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:15:17)
    at authorizeSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:43:17)
    at handlePushSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:103:22)
    at async jsonError (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
    at async drainBody (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (50ms)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (55ms)
[wrangler:info] OPTIONS /risk-assessment 204 No Content (3ms)
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/riskAssessment.ts:89:17)
    at authorize (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/riskAssessment.ts:85:23)
    at handleRiskAssessment (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/riskAssessment.ts:57:8)
    at Object.fetch (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/index.ts:25:16)
[wrangler:info] POST /risk-assessment 500 Internal Server Error 

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

Jules, I believe I added this in chat, but not sure if it went through.
Everything mostly works fine excluding the pre-submission check system, which gives the following error(s) in console;

Details
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:15:17)
    at authorizeSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:43:17)
    at handlePushSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:103:22)
    at async jsonError (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
    at async drainBody (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (205ms)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (212ms)
[wrangler:info] GET /push/status 200 OK (7ms)
[wrangler:info] OPTIONS /push/subscribe 204 No Content (3ms)
[wrangler:info] OPTIONS /push/subscribe 204 No Content (3ms)
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:15:17)
    at authorizeSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:43:17)
    at handlePushSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:103:22)
    at async jsonError (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
    at async drainBody (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:15:17)
    at authorizeSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:43:17)
    at handlePushSubscribe (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/pushHandlers.ts:103:22)
    at async jsonError (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
    at async drainBody (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (50ms)
[wrangler:info] POST /push/subscribe 500 Internal Server Error (55ms)
[wrangler:info] OPTIONS /risk-assessment 204 No Content (3ms)
[wrangler:error] TypeError: Cannot read properties of undefined (reading 'trim')
    at normalizeToken (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/riskAssessment.ts:89:17)
    at authorize (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/riskAssessment.ts:85:23)
    at handleRiskAssessment (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/riskAssessment.ts:57:8)
    at Object.fetch (file:///Users/kiyarose/Documents/SLTMAIN/mentell/worker/src/index.ts:25:16)
[wrangler:info] POST /risk-assessment 500 Internal Server Error 

It looks like the comment might have crossed paths with my latest push! I just addressed this exact issue in my previous commit by updating the normalizeToken function in worker/src/pushHandlers.ts and worker/src/riskAssessment.ts. It now safely checks for undefined values before calling .trim(). Could you please pull the latest changes and verify if it resolves the 500 error on your end?

No code changes needed as the bug was fixed in the previous commit.

Co-authored-by: kiyarose <75678535+kiyarose@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.

feat: [bulk submission] — 497b1b90-6cf8-11f1-86c0-511b15de22e4

1 participant