[WAIT] When processing a route, use most specific mount paths first#748
Draft
schloerke wants to merge 13 commits into
Draft
[WAIT] When processing a route, use most specific mount paths first#748schloerke wants to merge 13 commits into
schloerke wants to merge 13 commits into
Conversation
More specific mount paths will be found by using this order Co-Authored-By: Bruno Tremblay <meztez@neoxone.com>
or use `private$mnts` where possible
schloerke
commented
Jan 4, 2021
| private$mnts | ||
| mnts <- private$mnts | ||
| if (length(mnts) == 0) return(mnts) | ||
| mnts[sort(names(mnts), decreasing = FALSE)] |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| mnts[sort(names(mnts), decreasing = FALSE)] | |
| mnts[order(names(mnts), decreasing = FALSE)] |
schloerke
commented
Jan 4, 2021
| # * Mounts `/aaa` and `/aaa/bbb` exist. | ||
| # * We want to use mount `/aaa/bbb` as it is more specific | ||
| # TODO | ||
| # * If `/aaa/bbb` mount does not support `/aaa/bbb/foo`, then try mount `/aaa`. |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| # * If `/aaa/bbb` mount does not support `/aaa/bbb/foo`, then try mount `/aaa`. | |
| # * If `/aaa/bbb` mount does not support `/aaa/bbb/foo`, then try mount `/aaa` with route `/bbb/foo`. |
schloerke
commented
Jan 4, 2021
| path <- paste0(path, "/") | ||
| } | ||
|
|
||
| # order the mounts so that the more specific mount paths are ahead of the less specific mount paths |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| # order the mounts so that the more specific mount paths are ahead of the less specific mount paths | |
| # Add the mount to the original mount order | |
| private$mnt_order <- c(private$mnt_order, path) | |
| # Order the mounts so that the more specific mount paths are ahead of the less specific mount paths |
schloerke
commented
Jan 4, 2021
Comment on lines
+1052
to
+1054
| mnts <- private$mnts | ||
| if (length(mnts) == 0) return(mnts) | ||
| mnts[sort(names(mnts), decreasing = FALSE)] |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| mnts <- private$mnts | |
| if (length(mnts) == 0) return(mnts) | |
| mnts[sort(names(mnts), decreasing = FALSE)] | |
| private$mnts[private$mnt_order] |
Collaborator
Author
|
This change is deemed too dangerous. Maybe approach this with cc @cpsievert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #734
Fixes #773
Reprex:
... Which mount processes
/aaa/bbb/hello?/aaa/aaa/bbbPR task list:
devtools::document()Questions:
pr$mounts?Answer: No. Keep
pr$mountsthe same