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

Add default type and timestamps to approval controller #309

Merged
merged 9 commits into from
Nov 18, 2020

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Nov 15, 2020

  1. Replace the internal NO_TYPE with a user-specified default type.
  2. Allow ApprovalController.has lookups by type only, not just origin and type.
  3. Add Date.now() timestamps to approvals.
  4. Rename ApprovalInfo interface to Approval
  5. Fix a bug in _validateAddParams (origin type check too loose)

(1) The internal NO_TYPE added complexity to the implementation and API for virtually no benefit. This PR replaces this internal type with a user-specified default type. All stored approvals will now have a string type associated with them. In addition, (2) this PR fixes an oversight with the ApprovalController.has method, namely that there was no way to look up pending approvals by type only. These changes are breaking.

3 is because it may be useful to know when requests were created, e.g. for sorting. 4 is because why not, 1 and 2 are already breaking. 5 is because, we're already here.

@rekmarks rekmarks requested a review from a team as a code owner November 15, 2020 03:59
@rekmarks rekmarks merged commit c7fd7db into develop Nov 18, 2020
@rekmarks rekmarks deleted the approval-controller-timestamp branch November 18, 2020 20:14
@Gudahtt
Copy link
Member

Gudahtt commented Dec 17, 2020

I'm having trouble understanding what this "default approval type" is for. Why would we want a default approval type? What should this be set to for the extension Approval controller?

Adding any approval without an explicit type sounds like a disaster. I would prefer that an error be thrown upon any attempt to add an approval without a type.

MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* Add approval controller request times

* Fix ApprovalInfo interface documentation

* Fix some docstrings

* Remove NO_TYPE, add consumer-specifed default type

* Rename ApprovalInfo interface to Approval

* Fix some docstrings

* Fix _validateAddParams bugs
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* Add approval controller request times

* Fix ApprovalInfo interface documentation

* Fix some docstrings

* Remove NO_TYPE, add consumer-specifed default type

* Rename ApprovalInfo interface to Approval

* Fix some docstrings

* Fix _validateAddParams bugs
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.

3 participants