Commit 0aadbd1
Core Data: report autosave resolution on every exit path
The completion dispatch sat on the success path only, so an early return
(unknown author, post type without autosave support) or a rejected request
skipped it. hasFetchedAutosaves then stayed false and
isEditedPostAutosaveable never enabled autosaving for the session.
This was a regression against the delegation it replaced: that completed
getAutosaves resolution unconditionally, and hasFinishedResolution treats an
errored resolution as complete, so even a failed fetch counted as fetched.
Move the dispatch into a finally, and correct the docblock, which claimed
getAutosaves was unaffected. Reporting against its key also suppresses that
resolver via hasStartedResolution, so a later direct call returns the stored
single-author array rather than refetching.
Two existing tests asserted the dispatch was NOT made on the early-return
paths, encoding the bug as intended behavior. They now assert the opposite,
and cover the failed-request path.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent c940518 commit 0aadbd1
3 files changed
Lines changed: 131 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
636 | 648 | | |
637 | 649 | | |
638 | 650 | | |
| |||
641 | 653 | | |
642 | 654 | | |
643 | 655 | | |
644 | | - | |
645 | | - | |
646 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
647 | 660 | | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
653 | 666 | | |
654 | | - | |
655 | | - | |
656 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
657 | 670 | | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
668 | 681 | | |
669 | | - | |
670 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
671 | 687 | | |
672 | | - | |
673 | | - | |
674 | 688 | | |
675 | 689 | | |
676 | 690 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
127 | 179 | | |
128 | 180 | | |
129 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
958 | 958 | | |
959 | 959 | | |
960 | 960 | | |
961 | | - | |
| 961 | + | |
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
971 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
972 | 977 | | |
973 | 978 | | |
974 | | - | |
| 979 | + | |
975 | 980 | | |
976 | 981 | | |
977 | 982 | | |
| |||
987 | 992 | | |
988 | 993 | | |
989 | 994 | | |
990 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
991 | 1022 | | |
992 | 1023 | | |
993 | 1024 | | |
| |||
0 commit comments