Skip to content

Show toast in more cases after submitting iframe form - #1869

Draft
matthew-white wants to merge 2 commits into
masterfrom
robust-check-problem
Draft

Show toast in more cases after submitting iframe form#1869
matthew-white wants to merge 2 commits into
masterfrom
robust-check-problem

Conversation

@matthew-white

@matthew-white matthew-white commented Sep 3, 2026

Copy link
Copy Markdown
Member

This PR is a work in progress that I started during development on v2026.3, when I was looking at getodk/central#2080. This PR closes getodk/central#2188.

The main left to do is to add more tests. I feel pretty good about the changes to src/ itself.

What has been done to verify that this works as intended?

I've added one new test so far, but there's still more to test.

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e1a2072

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@matthew-white
matthew-white marked this pull request as draft September 3, 2026 01:34
@matthew-white
matthew-white force-pushed the robust-check-problem branch 2 times, most recently from d02469a to 80ae622 Compare September 3, 2026 01:38

@matthew-white matthew-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Notes about decisions I made and questions I have

Comment on lines 286 to 287
// Note that the Problem may be wrapped in another element, for example,
// a <pre> element.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe this comment should be moved above, above where I define textContent?

"submit": "Data download should begin soon. Once it begins, you can close this message. If it hasn’t started in 20 seconds, please try again.",
"parseError": "Something went wrong while requesting your data."
"parseError": "Something went wrong while requesting your data.",
"somethingWentWrong": "@:alert.parseError"

@matthew-white matthew-white Sep 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want to rename parseError to somethingWentWrong. That's because I want to use the same message for more cases (the cases that this PR addresses). In other words, I just want to rekey the message. @: is Vue I18n syntax. We could also use @transifexKey instead. Usually we use @transifexKey, but @: is possible in this case because it's a rekey within the same file.

const clock = sinon.useFakeTimers(Date.now());
const modal = await setup(event => {
event.preventDefault();
// TODO. Mock the iframe document so that it throws.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is where I got stuck. I want to make it so that accessing window.document throws. Can I use sinon.replaceGetter() for that (specifying a getter that throws)? Or will that not work, since window.document isn't originally a getter?

modal.should.alert('danger', 'Something went wrong while requesting your data.');
});

it('logs the response', async () => {

@matthew-white matthew-white Sep 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I should probably update and/or copy this test as well. Both because there are new cases that do logging and because the existing case does more logging than before.

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.

Show error toast in more cases after submitting iframe form for submission download

1 participant