Closed Bug 84061 Opened 23 years ago Closed 23 years ago

Download/Sync now fails w/newly subscribed newsgroup

Categories

(SeaMonkey :: MailNews: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: trix, Assigned: Bienvenu)

References

Details

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.1) Gecko/20010604
Netscape6/6.1b1
BuildID:    2001060409

no messages are downloaded on newly subscribed and unread newsgroup.

Reproducible: Always
Steps to Reproduce:
1. In Mail/News, subscribe to a new newsgroup (ie.. 3b.config)
2. Before downloading messages, goto and select File\Offline\Download/Sync now... 
3. In dialog box, select "Newsgroup Messages" to download and click the
"Select.." button.
4. Select the new newsgroup (3b.config) and click OK.
5. Now, go offline and select the newgroup to read messages.

Actual Results:  No messages were downloaded

Expected Results:  All messages should have been downloaded for reading in
offline mode.
yes, for now, you have to open the newsgroups to get the headers first before we
know to download the message bodies.
Status: NEW → ASSIGNED
*** Bug 86818 has been marked as a duplicate of this bug. ***
Attached patch proposed fixSplinter Review
the basic fix is to make sure we download headers for the group before figuring
out which message bodies to download. I had to remove some code that was added
for custom headers:

-  nsCOMPtr <nsIFileSpec> pathSpec;
-  err= scopeFolder->GetPath(getter_AddRefs(pathSpec));
-  PRBool exists=PR_FALSE;
-  err = pathSpec->Exists(&exists);
-  if (!exists) return NS_ERROR_FILE_NOT_FOUND;
This code breaks offline downloading of newsgroups unless the newsgroup had
already downloaded message bodies. I tried custom headers while offline with
these lines removed and it didn't crash or anything, so I think those lines
should not be there. I understand that you were trying to make this search fail
if there was no offline message bodies for custom headers, but we can still do
offline search with no offline message body...and downloading of newsgroup
messages needs to work when there's no offline message file yet.

The other fixes make it so there's a reference to the newsgroup downloader -
otherwise, the ref count was going to 0 and we were crashing in some instances.


I also had to make getnewmessages use the uri listener, so I could know when
the url was finished running.

I also used some PRBackedBools where possible.
Navin, if you could review this, that would be great, thx!
the problem was not that it was crashing but it went into an infinite loop
with throbber going forever, IIRC. 
oh right, I fixed that too:

    rv = scope->TimeSlice (aDone);
    if (NS_FAILED(rv))
      *aDone = PR_TRUE;

Comment on attachment 67134 [details] [diff] [review]
proposed fix

ok, r=naving.

one minor nit

@@ -671,12 +671,14 @@
	// disk, this is the fastest way to do it.

   NS_ENSURE_ARG(aDone);
-
+  nsresult rv = NS_OK;

do not initialize
rv (brendan told seth
about this)
Attachment #67134 - Flags: review+
thx, your point is taken about initializing rv but I thought the control flow
was just complicated enough that I didn't want someone making a change that made
rv be returned unitialized.

if the code was something like
nsresult rv= NS_OK;
rv = Foo();

then I would agree 100%.
this basically works now. I'll try some more tests, but I've checked in this
fix, and it seems to work.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Using commercial builds:
1-31-06-trunk win nt 4.0
1-31-08-trunk linux 2.2, mac 9.1

Verified that if you subscribe to a new newsgroup(s)
and then immediatly go to download/sync now process (without
first clicking on the newly subscribed newsgroups to get
headers) and download those new newsgroups, the
result is the newsgroups are downloaded.

Will verify when I test on MAC os 10.1
using 2002020418 on mac 10.1.2

In both Modern/classic, I am able to subscribe and download
a brand new newsgroup w/out first clicking the newsgrp and
getting the headers.

marking as verified.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: