Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode header fields if they exist on schedule edit #2405

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

Alex-Tideman
Copy link
Contributor

@Alex-Tideman Alex-Tideman commented Oct 23, 2024

Description & motivation 💭

If a schedule startWorkflow has been created or edited to include header fields, and then edited in the UI, upon save it would error due to the header fields not being encoded. This ensures the fields get encoded upon save if they exist.

Screenshots (if applicable) 📸

Screenshot 2024-10-23 at 10 07 52 AM

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 4:37pm

for (const [key, value] of entries) {
const encodedValue = await encodePayloads(
stringifyWithBigInt(value),
'json/plain',
Copy link
Contributor

@laurakwhit laurakwhit Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use the encoding value here as well?

Suggested change
'json/plain',
encoding

And if so, would we want to create a separate UI for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we just use plain/json for now. There's no UI for editing headers for schedules and not sure we want to add that yet. If we need to we can, but headers are almost always json/plain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah only concern here is that if a user has Codec Server set up with users who don't have /encode permissions then it will error on save unless we do a similar approach to #2384.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I added a try/catch for now and return if encoding errors for header fields

@Alex-Tideman Alex-Tideman merged commit eb11a09 into main Oct 23, 2024
14 checks passed
@Alex-Tideman Alex-Tideman deleted the fix-header-in-schedule branch October 23, 2024 16:43
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