drummerSupport icon indicating copy to clipboard operation
drummerSupport copied to clipboard

Issue with building the blog

Open am1t opened this issue 4 years ago • 91 comments

I have observed a curious issue for two consecutive days now. The build does not update the blog for the first post I create on a day via Drummer. It happened on both 19th and 20th of October. For reference, here's the blog.opml and here's the blog url. It's such a peculiar behavior, but I wanted to capture the observations.

I was able to successful publish a post late last night, the last post on the 19th. However, the post I wrote today (20th) wasn't getting published. Between these two posts, I had not made any change to the setup. Same behaviour was observed y'day.

I tried the below things to fix the issue, but I was not successful.

  1. Hard reload of both Drummer and Blog.
  2. Deleted the new post and added it again. Followed by rebuild.
  3. Removed all the newly added scripts for Micro.blog and rebuild. (I thought the M.b integration possibly caused it.)
  4. Keep only the blog.opml active and rebuild.

Nothing worked, the new post wasn't added on the blog, though present in OPML. But here's what worked on both the days.

  1. Deleted all the new posts.
  2. Update an existing post by adding some text.
  3. Rebuild the blog.
  4. The updates are visible on the blog.
  5. Add a new post and rebuild again. The new post is also visible on the blog.

Post this, the build starts working as expected, new posts are instantaneously made available. Given the curious nature of the issue, I don't know whether the cause can be easily found, and so don't expect a fix. I will keep an eye on this behaviour tomorrow too and report back the observations.

Just a data point, I see this error on the console when I load Drummer, I am not certain if this is related, though.

startRoot: codetext == root. = 
Uncaught SyntaxError: missing name after . operator

am1t avatar Oct 20 '21 06:10 am1t

I am unable to reproduce the issue today. So, closing the issue -- I am unsure of the behaviour.

am1t avatar Oct 21 '21 04:10 am1t

@am1t -- i read this report yesterday and couldn't think about how to reproduce it.

btw, the error you saw comes from having an empty root file. nothing to worry about. harmless, we should probably check for it. ;-)

scripting avatar Oct 21 '21 12:10 scripting

@scripting I have currently hit this issue again. I don't know how to reproduce this one, as it didn't occur yesterday. Only, difference is the timing of the post. Here's the blog.opml and here's the blog url.

There's an additional post in opml made today that no amount of rebuilding is adding to the blog. But updates to old posts are getting shown.

Update: I see that the JSONified RSS for the blog does contain the posts. But the permalink in there do not take you to the posts.

am1t avatar Oct 22 '21 02:10 am1t

Can you carefully describe what you’re seeing that’s wrong?

In the initial post I didn’t understand what went wrong.

scripting avatar Oct 22 '21 07:10 scripting

I have written a couple of posts today (22nd of October) in Drummer - screenshot below.

image

When I rebuild the blog, they are not visible on the oldschool blog -- screenshot below.

image

However, they are visible in the JSONified RSS -- screenshot below.

image

I hope this clarifies.

am1t avatar Oct 22 '21 07:10 am1t

I can’t look into it for a few hours. Do you think it’s a time zone thing? Will the posts eventually show up?

scripting avatar Oct 22 '21 08:10 scripting

Sure, not an urgent issue. I can hold on -- that will provide the best setup to debug. I do think it has got something to do with time zone. But, I don't think it will show up with just a rebuild. I have tried that.

What, I believe, will help is if I delete all the posts from today and post them again. But I want to do that when you can debug in backend.

am1t avatar Oct 22 '21 08:10 am1t

Look at the attributes on the heads that don’t show up, esp the created atts.

On Friday, October 22, 2021, Amit Gawande @.***> wrote:

Sure, not an urgent issue. I can hold on -- that will provide the best setup to debug. I do think it has got something to do with time zone. But, I don't think it will show up with just a rebuild. I have tried that.

What, I believe, will help is if I delete all the posts from today and post them again. But I want to do that when you can debug in backend.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scripting/drummerSupport/issues/88#issuecomment-949405675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM32O2EWXAEHP6TM22JEI3UIEOOPANCNFSM5GK2I4NQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

--

scripting avatar Oct 22 '21 09:10 scripting

Nothing looks out of order -- the created time is displayed for the post in GMT. For the latest post, it is later than what it was for the first post yesterday. And even that's not shown. I will repost and rebuild once you confirm.

am1t avatar Oct 22 '21 11:10 am1t

I found the problem, and recorded a voicemail explaining. (It is not fixed yet.)

http://scripting.com/2021/10/22/progressonTimeZoneProblem.m4a

What determines if you'd have this problem is if you clicked the big plus icon before it's the 22nd (or whatever day) in the Eastern Time Zone of the US.

In other words if you started blogging earlier in the day, you'd be missing the entire day's posts.

That voicemail is me thinking aloud, you might find it interesting. ;-)

scripting avatar Oct 22 '21 13:10 scripting

Also, please don't change your blog.opml file until i get this fixed. I don't want to have to build a new test case. Your current outline is perfect. :smile:

scripting avatar Oct 22 '21 13:10 scripting

Actually I shouldn't have spoken so soon. I don't see why this is false:

date.sameDay ("Fri, 22 Oct 2021 02:42:07 GMT", "Fri Oct 22 2021 08:53:07 GMT-0400 (Eastern Daylight Time)")

But if you run it in Drummer it does return false.

This is the same function Old School is calling.

Still puzzling.

scripting avatar Oct 22 '21 13:10 scripting

Also, please don't change your blog.opml file until i get this fixed.

As I said, I am not doing any reposting/rebuilding till we get this fixed. I was angry the last time I let the bug get away :-)

But if you run it in Drummer it does return false.

This is absolutely puzzling. Would you be able to point to the relevant code? I can try to take a look too.

am1t avatar Oct 22 '21 14:10 am1t

I figured it out.

And then there was another problem. But if you now look at your home page you will see the page for the 22nd is there. There may well be other problems like this.

I have not deployed the new version to the server, so if you rebuild it will revert to the incorrect version.

scripting avatar Oct 22 '21 14:10 scripting

The first problem was that for these comparisons we have to use the UTC versions of the JS date verbs.

function sameDayUTC (d1, d2) { //10/22/21 by DW 
	//returns true if the two dates are on the same day, in UTC
	d1 = new Date (d1);
	d2 = new Date (d2);
	return ((d1.getUTCFullYear () == d2.getUTCFullYear ()) && (d1.getUTCMonth () == d2.getUTCMonth ()) && (d1.getUTCDate () == d2.getUTCDate ()));
	}

The second problem was that when generating the path for the archive page we have to use your version of the time, not the server's version. That was a bit more tricky, but that appears to work now too.

scripting avatar Oct 22 '21 14:10 scripting

Also here's a better version of the drummer guy.

http://scripting.com/images/2019/12/24/drummer.png

scripting avatar Oct 22 '21 14:10 scripting

Great! I do see the posts from today -- whatever you did, has worked. I was about to comment that even the URLs look correct now. Earlier they weren't. So, very close to fixing the issue, then?

am1t avatar Oct 22 '21 14:10 am1t

Okay the new version of Old School is released, and deployed on the server, where it just rebuilt your blog, and it still looks correct, so you may now take control of your blog.opml.

It's good to get these bugs out. They were really serious ones. Also gave you a h/t in the update notes for Old School.

We make a good team. ;-)

scripting avatar Oct 22 '21 15:10 scripting

One more idea -- you might want to try reading the Old School code.

I expect you might spot some other problems, so we don't have to rely on trial and error.

Code reviews are a really important part of development and at some point I hope we can get something like that going.

In the meantime if you want to have a look at the changes in this release, here's the history. You might find it interesting.

scripting avatar Oct 22 '21 15:10 scripting

I see that fixes have just been deployed, but if I build my Drummer blog now, no entries pertaining to today appear in the published version.

I'm operating on a +8 timezone offset and my published Drummer is at http://oldschool.scripting.com/andrewcanion/

andrewcanion avatar Oct 22 '21 15:10 andrewcanion

Brilliant! Glad the issue finally got resolved. And absolutely relieved that I can start posting from Drummer, again. I have started enjoying this experience now! ;)

Also gave you a h/t in the update notes for Old School. We make a good team. ;-)

Hah! We do, isn't it :D

am1t avatar Oct 22 '21 16:10 am1t

One more idea -- you might want to try reading the Old School code.

Absolutely. Sure, will do. It will help catch issues, if any.

am1t avatar Oct 22 '21 16:10 am1t

@scripting I think there's possibly another edge case yet to be solved -- I believe Andrew has hit that. Here's the scenario - GMT and server share the same day, but the writer's time zone wise it is the next day. I am going to run through the code with this scenario.

am1t avatar Oct 22 '21 16:10 am1t

Here's another test case of what appears to be the same issue if you'd like more data to investigate/reproduce the issue:

OPML = http://drummer.scripting.com/_leonmika/blog.opml Blog URL = http://workingset.net

This is for GMT+11 — Australian Eastern Daylight Saving Time.

I'll hold off from updating this blog until further notice. Cheers.

lmika avatar Oct 22 '21 22:10 lmika

After an 8-hour sleep, I did another build this morning. This build eliminated the latest day from the published version.

So 22nd never published, this morning the 21st “unpublished” on build. It is currently 8am on the 23rd in my Timezone.

andrewcanion avatar Oct 23 '21 00:10 andrewcanion

I see Dave has published a Change log entry for this bug.

@andrewcanion I see the html pages for the dates for both 22nd and 21st are present. They are just not displayed on the home page. From the change log, I believe Dave is aware of the issue.

am1t avatar Oct 23 '21 03:10 am1t

I created a new blog post today, the first for the day. I clicked Tools, Build my blog. I see the message "There was an error building the blog:" I tried closing and re-opening the blog.opml file with no change. I logged out and logged back in to drummer with no change. I cleared browser cache and closed, restarted the browser with no change.

I opened browser console and selected Build my blog and captured the following screenshot: Screenshot 2021-10-23 11 42 01 AM

fmcpherson avatar Oct 23 '21 15:10 fmcpherson

@fmcpherson -- reported also in another thread.

https://github.com/scripting/drummerSupport/issues/97#issuecomment-950180851

scripting avatar Oct 23 '21 17:10 scripting

OK -- once I gave up on getting it done today, I started to think about the problem differently.

As you can hear in my second voicemail, the question that was so hard to answer is this:

What day is it in the location the user is in?

I said it's just an algorithm, it must be possible to get the computer to figure that out.

So I put together this little app.

http://scripting.com/code/testing/whatdayisit/

I'm turning to my friends around the world to check this little app, over the course of a day and let me know if it's got it right.

scripting avatar Oct 23 '21 20:10 scripting

I think I might know what may have caused my problem this morning. I am traveling and created that first post using my iPad that automatically changed to CST where I am currently located. I normally am in EST, so could the different time zone of the computer I am using to run Drummer caused the problem? I've read the instructions about Getting Time Time Zone right but at the time I read I was home in EST and thus didn't add the head-level attribute. Now I am think that given I might post while traveling in a time zone other than EST that I should have timeZoneOffset populated.

In the mean time, while I am on this trip, I am only going to create posts in Drummer using another computer that hasn't changed time zones.

fmcpherson avatar Oct 23 '21 21:10 fmcpherson