Commit bdca56e
committed
ADFA-5067: Stop a link dying permanently on a failed or unverifiable resolve
Two ways a deep link could go silently dead forever, both in the consumption
bookkeeping.
A transient filesystem failure was recorded as "no such project".
resolveWithinDirectory maps everything that is not Contained to null, so
ContainedPathResolver's Resolution.Unverifiable -- an IOException the resolver
models explicitly as "not an escape, refused because unproven" -- arrived at
findValidProjectByName indistinguishable from a genuine miss. An EACCES right
after a storage-permission change, or an EIO on a flaky SD/FUSE mount, therefore
told the user "No project named X was found" about a project that plainly exists,
and MainActivity then recorded the request consumed on the stated reasoning that
the project does not exist -- so the identical URL was a silent no-op on every
later delivery. The SecurityException path had the same problem.
Add lookupValidProjectByName, returning Found/NotFound/Unverifiable, and have
resolveDeepLinkProject return the matching tri-state instead of File?. Only a
definitive NotFound is recorded consumed. Unverifiable now reports the scan-failed
message rather than "no project named X": telling someone a project they can see
in the projects list does not exist is worse than admitting the lookup failed. An
Unverifiable from one Unicode normal form does not mask a Found from another --
it is remembered and only returned if no candidate form resolves.
findValidProjectByName stays, reduced to a null-or-directory view for the callers
that cannot act on the difference.
A fresh tap was mistaken for a programmatic re-delivery. The re-forward gate
dropped any request already in consumedDeepLinkRequests. It exists to stop a
bounce loop -- MainActivity opens a project, the editor decides the link names a
different one and bounces it back, and the dialog goes straight back up -- but it
could not tell that loop from a genuinely new tap that happens to be re-forwarded,
and DeepLinkRequest carries no nonce, so a repeat tap is equal by value to the
earlier one. Tapping a link for a project that does not exist yet, creating it,
then tapping again was dropped with no dialog, no error and no log, on that and
every subsequent tap -- which is the flow the feature exists for.
Track the failed-resolve consumptions separately in unresolvedDeepLinkRequests and
exempt them from the gate. A request that never resolved never reached the editor,
so no bounce can originate from it and the loop cannot come back. The set is
persisted alongside consumedDeepLinkRequests, or the same sequence across a
process death lands in the identical hole, and a request is dropped from it as
soon as it is retried, so a later success stops the exemption.
The Unverifiable branch has no automated coverage: provoking a real EACCES/EIO
from the filesystem mid-call is not something a JVM unit test can do reliably. The
new tests pin the two outcomes that are reachable, plus that findValidProjectByName
still agrees with the lookup it now delegates to.
Claude-Session: https://claude.ai/code/session_01LuyR4ajssmKw1o1UQsjJbP1 parent e8bd904 commit bdca56e
5 files changed
Lines changed: 207 additions & 33 deletions
File tree
- app/src
- main/java/com/itsaky/androidide
- activities
- editor
- utils
- test/java/com/itsaky/androidide/utils
Lines changed: 45 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
123 | 140 | | |
124 | 141 | | |
125 | 142 | | |
| |||
161 | 178 | | |
162 | 179 | | |
163 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
164 | 186 | | |
165 | 187 | | |
166 | 188 | | |
| |||
604 | 626 | | |
605 | 627 | | |
606 | 628 | | |
607 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
608 | 634 | | |
609 | 635 | | |
610 | 636 | | |
| |||
624 | 650 | | |
625 | 651 | | |
626 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
627 | 657 | | |
628 | 658 | | |
629 | | - | |
| 659 | + | |
630 | 660 | | |
631 | 661 | | |
632 | 662 | | |
633 | 663 | | |
634 | 664 | | |
635 | 665 | | |
636 | | - | |
| 666 | + | |
637 | 667 | | |
638 | 668 | | |
639 | 669 | | |
640 | 670 | | |
641 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
642 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
643 | 681 | | |
644 | 682 | | |
645 | 683 | | |
| 684 | + | |
646 | 685 | | |
647 | 686 | | |
648 | 687 | | |
| |||
672 | 711 | | |
673 | 712 | | |
674 | 713 | | |
| 714 | + | |
675 | 715 | | |
676 | 716 | | |
677 | 717 | | |
678 | 718 | | |
| 719 | + | |
679 | 720 | | |
680 | 721 | | |
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
2737 | 2738 | | |
2738 | 2739 | | |
2739 | 2740 | | |
2740 | | - | |
2741 | | - | |
| 2741 | + | |
| 2742 | + | |
2742 | 2743 | | |
2743 | 2744 | | |
2744 | 2745 | | |
| |||
2776 | 2777 | | |
2777 | 2778 | | |
2778 | 2779 | | |
2779 | | - | |
| 2780 | + | |
2780 | 2781 | | |
2781 | 2782 | | |
2782 | 2783 | | |
| |||
Lines changed: 52 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
30 | 48 | | |
31 | 49 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
35 | 53 | | |
36 | 54 | | |
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
40 | 58 | | |
41 | 59 | | |
42 | | - | |
43 | | - | |
| 60 | + | |
| 61 | + | |
44 | 62 | | |
45 | | - | |
| 63 | + | |
46 | 64 | | |
47 | 65 | | |
48 | 66 | | |
49 | 67 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
56 | 71 | | |
57 | 72 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
64 | 99 | | |
65 | | - | |
66 | 100 | | |
Lines changed: 61 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
25 | 52 | | |
26 | 53 | | |
27 | 54 | | |
| |||
31 | 58 | | |
32 | 59 | | |
33 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
34 | 64 | | |
35 | | - | |
| 65 | + | |
36 | 66 | | |
37 | 67 | | |
38 | | - | |
| 68 | + | |
39 | 69 | | |
40 | 70 | | |
41 | 71 | | |
42 | 72 | | |
43 | 73 | | |
44 | 74 | | |
45 | | - | |
| 75 | + | |
46 | 76 | | |
47 | | - | |
| 77 | + | |
48 | 78 | | |
49 | 79 | | |
50 | 80 | | |
51 | 81 | | |
52 | 82 | | |
53 | 83 | | |
54 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
55 | 89 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
59 | 106 | | |
60 | 107 | | |
61 | | - | |
| 108 | + | |
62 | 109 | | |
63 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
64 | 117 | | |
65 | 118 | | |
66 | 119 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
105 | 150 | | |
0 commit comments