Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fix deleting history entry #10069

Merged
merged 1 commit into from
Aug 4, 2017
Merged

Fix deleting history entry #10069

merged 1 commit into from
Aug 4, 2017

Conversation

diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Jul 19, 2017

fix #8761

test plan:

  1. open a new tab, go to some site
  2. close the tab
  3. open about:history. right-click to delete the site. it should disappear from the list
  4. open the History menu. you should no longer see the site under 'Recently Closed'.
  5. repeat above steps but opening/closing two tabs and selecting both of them to delete instead of only one

I tried to write a test for this but couldn't find a way to get Webdriver to click on a context menu item in about:history.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@@ -417,6 +417,10 @@ module.exports.removeSite = function (state, siteDetail, tag, reorder = true, sy
site = site.set('tags', tags)
return state.setIn(stateKey, site)
} else {
if (!tag && module.exports.isHistoryEntry(siteDetail)) {
// Delete the site from history
return state.deleteIn(stateKey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't delete history for a reason which is to prevent #7238 from happening. This line will cause the regression of #7238.
Maybe we should revisit this after #10136 landed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darkdh module.exports.isHistoryEntry verifies that the site is not a bookmark or a pinned tab before deleting it. but you're right that #10136 probably affects this PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#10136 is in the 0.21.x milestone whereas this issue should be fixed in 0.19.x

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I tried this PR with STR in #7238. bookmark will disappear and pinned tab will also disappear after relaunch

fix #8761

test plan:
1. open a new tab, go to some site
2. close the tab
3. open about:history. right-click to delete the site. it should disappear from the list
4. open the History menu. you should no longer see the site under 'Recently Closed'.
5. repeat above steps but opening/closing two tabs and selecting both of them to delete instead of only one
@diracdeltas
Copy link
Member Author

@darkdh good catch, i think it's fixed now

@codecov-io
Copy link

codecov-io commented Aug 3, 2017

Codecov Report

Merging #10069 into master will decrease coverage by 0.01%.
The diff coverage is 59.09%.

@@            Coverage Diff             @@
##           master   #10069      +/-   ##
==========================================
- Coverage   52.95%   52.93%   -0.02%     
==========================================
  Files         228      228              
  Lines       20308    20327      +19     
  Branches     3253     3258       +5     
==========================================
+ Hits        10754    10761       +7     
- Misses       9554     9566      +12
Flag Coverage Δ
#unittest 52.93% <59.09%> (-0.02%) ⬇️
Impacted Files Coverage Δ
js/actions/windowActions.js 5.6% <0%> (ø) ⬆️
js/stores/appStore.js 11.15% <0%> (-0.04%) ⬇️
js/state/siteUtil.js 87.06% <100%> (-0.06%) ⬇️
app/browser/menu.js 55.17% <57.14%> (+0.44%) ⬆️
js/stores/windowStore.js 30.39% <66.66%> (-0.51%) ⬇️

Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm now!

@diracdeltas diracdeltas merged commit 2dbc38c into master Aug 4, 2017
@diracdeltas
Copy link
Member Author

Merging. need to make sure this works after #10296

diracdeltas added a commit that referenced this pull request Aug 4, 2017
diracdeltas added a commit that referenced this pull request Aug 4, 2017
@bsclifton bsclifton deleted the fix/delete-history branch August 30, 2017 19:30
@luixxiul
Copy link
Contributor

I added reverted but cannot remember which commit reverted this one.

@luixxiul luixxiul removed the reverted label Sep 20, 2017
@diracdeltas
Copy link
Member Author

@luixxiul should #8761 and #10328 be reopened then?

@bsclifton
Copy link
Member

bsclifton commented Oct 9, 2017

@luixxiul was this actually reverted? Per @diracdeltas comment above, should the two issues she mentioned be reopened?

@luixxiul
Copy link
Contributor

I think I misunderstood something. please ignore #10069 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

History entries often cannot be deleted
6 participants