-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Edits] Engine I/O support for editing submitted instances #349
Conversation
🦋 Changeset detectedLatest commit: 87523b7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
97ef52c
to
855f50c
Compare
Both of these types will have additional usage in the next commit. Re: `Awaitable` This type is so general/common, I’m surprised we don’t already have a shared type for it (although our APIs have a lot less asynchrony than many typical JS/TS projects) Re: `Thunk` We’ve probably got a bunch of these floating around in some form or another, but I only found one usage _by name_. Note: there are some cases which technically have the same effective type, but use a different name for clarity (self-documentation, often semantically important). Most of these are the `Accessor` type we import from Solid, where it’s useful to know that a Solid “accessor” is **reactive**. So… let’s not _over-generalize_ this as we come across same-type cases!
855f50c
to
7fec2f2
Compare
13a1be0
to
c0be03e
Compare
* - The `odk-instance-first-load` event itself will **NOT** be triggered | ||
* | ||
* - Preload attributes _other than `uid`_ will **NOT** be recomputed | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lognaturel This describes both the I/O aspects of this PR, as well as semantics I'm implementing in #352. If you get a chance, could you take a quick look and correct anything I might have gotten wrong about the semantics of the latter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the PR has now been approved, and in the interest of moving forward on #352, I've revised this JSDoc to be less specific about application of the preload="uid"
case (matching the current behavior there, pending tests to validate).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you, this was easy to navigate and understand
This generally follows the same patterns as `restoreInstance`, except that we anticipate needing to perform I/O to resolve instance and attachment input.
Note that this has several known limitations, which are detailed in JSDoc `@todo`s on `resolveInstanceAttachmentMapSource`
…7 LOC)… … commit summary includes a LOC delta to call out that this was specifically done, and done now, to be mindful about concerns expressed over this module’s line count. This consolidates: - `Scenario.config`: as a shared/reusable initialization input - `Scenario.fork`: as a shared mechanism to create a new `Scenario` instance from a new `instanceRoot` (aka engine’s `RootNode`) This is being done now to prepare for addition in the next commit of another use of `Scenario.fork` for testing initializing instance state for edit.
…dit APIs Note: as with the preceding commit, this change is intentionally mindful of concerns about the `Scenario.ts` module’s line count. While this does increase the count from the previous commit, it’s still at a net -30 LOC count on this branch.
c0be03e
to
87523b7
Compare
Part of #247.
Note: I've done my best to balance:
deprecatedID
andinstanceID
edit semantics #352)I have verified this PR works in these browsers (latest versions):
Once again, I don't think there's anything browser specific here!
What else has been done to verify that this works as intended?
InstancePayload
as instance state #345, divergence specifically accounting for the likelihood that editing submitted instances will be I/O-bound. (As designed in Engine/client interface: editing serialized instance state #299.)InstancePayload
as instance state #345) to exercise the same functionality for "edit". This pattern should probably be applied for all overlapping functionality between the two: it was low impact to set up, and will allow for more focused coverage of "edit"-specific functionality ([Edits] Support fordeprecatedID
andinstanceID
edit semantics #352).Why is this the best possible solution? Were any other approaches considered?
Nearly everything in this PR has already been determined in prior work:
InstancePayload
as instance state #345Any other approach would involve reconsidering all of that preliminary work, which I think we'd rather avoid.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
There's one big elephant in the room, which I consider important to address. In its current state, this change includes support for resolving instance attachments which is:
Given all of those caveats, I intentionally split that aspect of I/O into separate commits:
(Note: the commits referenced above
are present in the branch at time of writinghave now been rebased to roll back to the behavior of 1 + link to 2. I'll reword this section more thoughtfully with my morning brains.)I split the commits this way so it would be trivial for us to roll back to the implemented-albeit-naively-but-blocked state. Which, for this PR (and for the current Central release plan as I understand it)... I highly recommend we do roll it back!
Even if we don't have a clear indication at form load/instance creation time that instance attachments are not supported, we would definitely provide users with a clear indication that Web Forms isn't yet ready to edit instances with attachments.
Do we need any specific form for testing your changes? If so, please attach one.
N/A
What's changed
I think the above pretty much covers it!