Skip to content

restore-file - Fix discarding new or empty files#9133

Merged
SunsetTechuila merged 7 commits into
mainfrom
restore-file-empty-and-new
Apr 2, 2026
Merged

restore-file - Fix discarding new or empty files#9133
SunsetTechuila merged 7 commits into
mainfrom
restore-file-empty-and-new

Conversation

@SunsetTechuila
Copy link
Copy Markdown
Member

@SunsetTechuila SunsetTechuila commented Mar 27, 2026

Fixes #9120 (comment)

I believe it's #7650 that broke new files support

Test URLs

https://github.com/refined-github/sandbox/pull/128/changes

Screenshot

msedge_bUR1h9PjXV

@SunsetTechuila SunsetTechuila force-pushed the restore-file-empty-and-new branch from 38a44e6 to 37411b8 Compare March 27, 2026 11:02
@fregante
Copy link
Copy Markdown
Member

What was the decision on new files? I remember we just did not show the button at some point because it's a duplicate of the Delete File menu item

@SunsetTechuila
Copy link
Copy Markdown
Member Author

#6670 (comment)

@SunsetTechuila
Copy link
Copy Markdown
Member Author

Still relevant

@SunsetTechuila

This comment was marked as off-topic.

@fregante

This comment was marked as off-topic.

Comment thread source/github-helpers/api.tsx Outdated
@fregante

This comment was marked as off-topic.

@SunsetTechuila SunsetTechuila marked this pull request as ready for review March 28, 2026 03:55
@fregante
Copy link
Copy Markdown
Member

fregante commented Apr 2, 2026

What's the status of this PR and the feature itself? Does it not work fully in every case we want to cover? What are the limitations if any? Is the PR title up to date?

@SunsetTechuila
Copy link
Copy Markdown
Member Author

What's the status of this PR

Ready to be merged

and the feature itself?

It works for everything other than binary, new, or empty files

What are the limitations if any?

return httpStatus === 404 ? undefined : textContent;

We can also get 404 if we pass wrong name/ref to the query

Is the PR title up to date?

Yes

@SunsetTechuila

This comment was marked as resolved.

@SunsetTechuila SunsetTechuila merged commit 5176765 into main Apr 2, 2026
9 checks passed
@SunsetTechuila SunsetTechuila deleted the restore-file-empty-and-new branch April 2, 2026 09:29
@SunsetTechuila

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants