Closed Bug 42001 Opened 25 years ago Closed 25 years ago

[FEATURE]Clear History button in preferences doesn't work

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: phil, Assigned: waterson)

References

Details

(Keywords: helpwanted, Whiteboard: [nsbeta3-] [PDTP2] [rtm++] FIXED ON TRUNK r=bienvenu, sr=be)

Attachments

(2 files)

Using 2000-06-08-08 on NT 1. Open Preferences dialog 2. Click Navigator item if necessary 3. Click on Clear History button and OK the dialog 4. Tasks | Tools | History 5. History window comes up, contents not cleared I looked for a dup of this and amazingly couldn't find one.
Ben, Did you mention yesterday that you got a patch from someone for this?
Status: NEW → ASSIGNED
Summary: Clear History button in preferences doesn't work → [FEATURE]Clear History button in preferences doesn't work
Target Milestone: --- → M17
Over to slamm,
Assignee: radha → slamm
Status: ASSIGNED → NEW
ben, you gotum patchum?
Assignee: slamm → ben
submitting for nsbeta3, we minused a related bug b/c this was supposed to be in and working. If it's not then it needs to. People need to be able to clear their history.
Keywords: nsbeta3
confirming on linux
OS: Windows NT → All
Hardware: PC → All
nav triage team: congratulations, Steve, you are the owner of another bug. Enjoy.
Assignee: ben → slamm
Whiteboard: [nsbeta3+]
Priority: P3 → P2
Keywords: helpwanted
Whiteboard: [nsbeta3+] → [nsbeta3+] Haven't looked at this. Lower priority than my other bugs.
I talked to waterson about this. The global history datasource does not have a "clear" method. First, we need to figure out how to clear the history items from the mork database. Second, we need to have that reflected in the history datasource. Finally, we need to make sure the history observers get notified of the change (i.e. if the history window is open, you will see all the items disappear). Waterson also mentioned that the mork method, CompressCommit(), should be called after deleting the history items.
Whiteboard: [nsbeta3+] Haven't looked at this. Lower priority than my other bugs. → [nsbeta3+] More than a simple UI hook-up. Need to implement nsIGlobalHistory::clear().
Slamm, can I take this off your hands?
Sure, that would be great. I have not had a chance to work on this any more.
Accepting bug. (unless anyone else has been working on it in the meantime).
Status: NEW → ASSIGNED
PDT agrees P2 since no workaround. You can't even delete from the History window
Whiteboard: [nsbeta3+] More than a simple UI hook-up. Need to implement nsIGlobalHistory::clear(). → [nsbeta3+] [PDTP2] More than a simple UI hook-up. Need to implement nsIGlobalHistory::clear().
jce2@po.cwru.edu, did you mean to reassign this bug to yourself (rather than just accepting it for slamm)?
YES, I meant to reassign this bug to myself. Read the exchange above. :P
Assignee: slamm → jce2
Status: ASSIGNED → NEW
Are you actually doing work on this nsbeta3+ bug? If not, reassign it to someone who is.
I'm doing work on this, but will happily hand the bug over to anyone who understands the mork database api (which is what the clear history routine will need to use). I took the bug from Steve because he couldn't do anything with it.
It would probably be easier to just delete the mork database file (after closing it, of course) and create a new one. Chris, is there any information that is stored here that we don't want cleared out? I imagine the sequence of events would be: 1. Clear the datasource, which would get rid of any objects holding onto mork rows. 2. Close the history db 3. delete history.dat, or whatever it's called 4. Create a new, empty history db using the code that creates the initial history db, and open it.
adding self to cc list.
Why does this bug keep getting set back to "new"? I keep accepting it. I'll GLADLY hand it over to someone who understands mork so I don't have to desperately take a look at mork in my spare free time in order to figure out how this patch should work. But in the meantime, no one else is willing to do work on this, so I am doing work on it. PLEASE stop resetting the bug to "new".
Status: NEW → ASSIGNED
Judging from the bug activity, it's been you that's been setting it back to "New". Don't know why that would be. Maybe a browser bug. Anyway, I don't believe you need to know anything about mork to fix this, as I previously explained.
Would deleting the file really be anything more then an ugly hack? Would all of the state be cleared properly?
It's not an ugly hack - it's a clever optimization! It's going to be faster than deleting every mork row one by one. It's trivial to write code to delete every row by hand and I can tell you how to do it if you want, but it would be faster to close the file, delete it, and start over. Here are the mork api's you would use to delete all the rows: get the history table (of type nsIMdbTable) Get a row cursor with GetTableRowCursor() use NextRow to get each row. Probably should call CutAllColumns on the row. Then, use nsIMdbTable::CutRow to cut that row from the table.
I guess the question is what does the history window look like (and how does autocomplete behave, etc.) after deleting the file? Do we have any stale history state hanging around? Seems easy enough to try it out, but if it's enough to delete the file, that seems pretty attractive.
Please don't misunderstand me - there's more involved than just deleting the history database and creating a blank one. I'm sorry if I gave that impression. I was just suggesting a way to deal with the mork part of this problem. Obviously, the rdf state has to be cleaned up, the tree widget needs to be notified that all the rows are gone, etc. Another way of handling this would just be to "pretend" the user did a select all followed by a delete - this would cause everything to get cleaned up - and presumably, deleting a single history entry deletes the corresponding mork row, so you wouldn't have to know any mork api calls - just the call that the history front end already makes when deleting a single entry.
Not holding PR3 for this. Marking nsbeta3- and adding rtm nomination since I think we'll either have to make this work or take out the UI.
Keywords: rtm
Whiteboard: [nsbeta3+] [PDTP2] More than a simple UI hook-up. Need to implement nsIGlobalHistory::clear(). → [nsbeta3-] [PDTP2] More than a simple UI hook-up. Need to implement nsIGlobalHistory::clear().
And we'll need to impliment this feature, because otherwise people won't really want to use Netscape (and they won't be honest about why either). I'm SO sorry about the delay on getting this done. I'm moving flats right now. :-(
*** Bug 55294 has been marked as a duplicate of this bug. ***
using a hack that would simulate a select all and delete won't work - because doing that doesn't work either. no manipulation to remove any part of the history within the browser works.
bienvenu, could I get you to look over the changes to nsGlobalHistory.cpp in the above patch to implement removal from history? I iterate through the rows in the history back to front, using the PosToRow() API; for each row that's removed, I cut the row, and then notify via RDF APIs. ben, could you review the changes to prefutilities.js?
reassigning to waterson...
Assignee: jce2 → waterson
Status: ASSIGNED → NEW
Keywords: rtmns601
Target Milestone: M17 → mozilla1.0
r=ben for the changes to js. but: shouldn't the method name have a lower case first letter? :P (removeAllPages)
Ben: waterson is doing "When in Rome" and minimizing changes. I'd rather he or someone else change the .idl file to use Mozilla XPIDL style on the trunk, and later, than to mix styles here in this patch, which hopes to get [rtm++]'d. I can give an r=, but nominate shaver to give the a= (he knows RDF, if not MDB). /be
I'm no RDF wizard, and that MDB stuff makes me cold in my heart, but it looks pretty good. I don't like the explicit comparisons to 0 in the conditionals if (err != 0) and they're not consistent with the pointer checks below, but other than that I can find no real nits to pick. sr=shaver
So we are going to try for rtm for this patch? It's going to be a tough argument. Brendan, can you officially r= (now that we have sr=shaver), and then + it once you do (if there's no concerns)?
Keywords: rtm
Whiteboard: [nsbeta3-] [PDTP2] More than a simple UI hook-up. Need to implement nsIGlobalHistory::clear(). → [nsbeta3-] [PDTP2] [rtm need info]
I'd like bienvenu to review the MDB usage. He's on vacation today, but should be available tomorrow.
Never mind -- bienvenu is out until Monday. He can review ex post facto if PDT agrees to take this.
I meant to give my r= -- sorry for any ambiguity. /be
OK, r=brendan sr=shaver. +'ing, Phil says David B. won't be back until Monday so we should try for ++ without waiting for his review.
Whiteboard: [nsbeta3-] [PDTP2] [rtm need info] → [nsbeta3-] [PDTP2] [rtm+]
I am not going to check this in on the branch until bienvenu has looked at it.
Status: NEW → ASSIGNED
Whiteboard: [nsbeta3-] [PDTP2] [rtm+] → [nsbeta3-] [PDTP2] [rtm need info]
patch checked in on trunk
Whiteboard: [nsbeta3-] [PDTP2] [rtm need info] → [nsbeta3-] [PDTP2] [rtm need info] FIXED ON TRUNK
the "clear history" button works in build 2000102004 (win98), but the delete function in the edit menu still doesn't work. does this need a new bug report?
ratman: I think that's covered by bug 37078
I don't know about the batch stuff - I suspect it does nothing. I'll check. After you cut the row, you should call row->CutAllColumns(morkEnv) - this may fix the leaks you mentioned.
your useage of postorow looks fine - pos is just a 0-based index, so you are using it correctly. The batch hint stuff does nothing corrently, but if mork supports sorting, then the hint stuff will be useful to tell it not to keep the sort tables up to date while the batch stuff is going on. r=bienvenu
bienvenu: Do I need to add a "CutAllColumns()" call? Or is the code ok as is...
I would strongly recommend adding the CutAllColumns call - if you don't, I think the row won't really fully go away. If you don't, at best you'll have memory leaks, and at worst, the rows will still be around. It's some mork bug that I've long since forgotten the details of, except that it might involve the fact that the same row can appear in multiple tables, and I don't think mork does the right thing when a row is removed from the last table, or something like that, unless you CutAllColumns.
Add "CutAllColumns()" call per bienvenu's suggestion; change "LargeCommit()" to "CompressCommit()" to force file to be nuked.
Wow, who knew those mork methods had such necessary effects! Their names do not connote what they do (but you noticed that already, I'm sure). /be
looks good, r=bienvenu
It's just a bug; adding this call works around the bug - the method names *do* do what they say they do (I assume you're commenting about the fact that you need to CutAllColumns after removing the row). I think I explained before that it was a bug, so maybe you're talking about something else.
Sorry, I missed your explanation citing a mork bug. But I also was commenting (hence my use of plural) on CompressCommit -- Compress to my reading does not connote "force file to be nuked", but maybe now I'm misunderstanding waterson's words. Who should give sr=? /be
I suspect you just misunderstood Chris's comment - compress commit on an empty database will essentially nuke the file. Compress commit in mork gets rid of all the incremental updates (hence the name Compress). For example, when you delete a row from a mork database, it doesn't rewrite the whole file; it just adds a record at the end that says "remove row foo", and row foo remains in the db on disk. This makes incremental updates of large db's faster. Compress commit writes out the db from scratch. I'm not sure who should do the sr - no one on the reviewers list has more experience with mork than Chris - in fact, no one else on the reviewers list probably has any experience with mork, the lucky bastards!
I'm delegating mork review to bienvenu and waterson, which makes it seem like this patch is under-reviewed, but I looked at the rest of it and gave an r=. So consider this my sr=. /be
We have a r=, and a sr=, this needs to go to rtm+ immediately.
Whiteboard: [nsbeta3-] [PDTP2] [rtm need info] FIXED ON TRUNK → [nsbeta3-] [PDTP2] [rtm need info] FIXED ON TRUNK r=bienvenu, sr=be
nominating rtm+
Whiteboard: [nsbeta3-] [PDTP2] [rtm need info] FIXED ON TRUNK r=bienvenu, sr=be → [nsbeta3-] [PDTP2] [rtm+] FIXED ON TRUNK r=bienvenu, sr=be
rtm double plus As I understand this, the modified (new) code is all restricted to the codepath associated with clearing history. AS such, it should (worst case) induce problems only when used, and should not leave us with much in the way of regressions (if any) unless we exercise the feature. As such, the risk seems low enough to land on the branch asap. Thanks for jumping all over this bug so quickly!!!!! Nice work. Please land asap on branch.
Whiteboard: [nsbeta3-] [PDTP2] [rtm+] FIXED ON TRUNK r=bienvenu, sr=be → [nsbeta3-] [PDTP2] [rtm++] FIXED ON TRUNK r=bienvenu, sr=be
Checked in on branch.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Keywords: ns601
WooHoo! VERIFIED Fixed on 2000102509 builds (Win98,MacOS 8.5.1, and Linux RH6) adding vtrunk keyword so this can be looked at on the trunk as well
Keywords: vtrunk
Verified fixed on Mac, Linux and Win 10/31 trunk builds.
Status: RESOLVED → VERIFIED
Keywords: vtrunk
Component: History: Session → Document Navigation
QA Contact: claudius → docshell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: