The Daily Parker

Politics, Weather, Photography, and the Dog

New technology, new weirdness

I've mentioned that Inner Drive Technology will release a new version of Weather Now pretty soon. I've finished everything except the UI and migrating the data, in fact, so I may even finish in January.

I have an odd bug, though, so I'm posting here in addition to the posts I made on Stack Overflow and on the Blazorise GitHub project.

In short, Blazorise speeds up UI development by abstracting away a lot of the formatting and layout for a .NET Blazor app. Blazor, in turn, abstracts away most of the lower-level UI code that makes websites interactive and fast. It's a long way from the XML-XSLT page construction I used in the last Weather Now UI update back in 2007. (Yes, the UI turns 15 soon—but the app itself turned 22 on November 11th.)

Without going too deeply into the issue, let me sum up. The new version will allow users to log in and customize their experience. But it still needs to work for anonymous users, who will make up probably 95% of the users.

The new site will continue the left-side navigation pane for desktop views. To do that, I built a MasterLayout.razor page that looks like the demo code in the Blazorise documentation:

<Layout Sider="true">
	<LayoutSider>
		<LayoutSiderContent>
			<Bar Breakpoint="Breakpoint.Desktop" NavigationBreakpoint="Breakpoint.Tablet" ThemeContrast="ThemeContrast.Dark"
			     Mode="BarMode.VerticalPopout" CollapseMode="BarCollapseMode.Small">
				<BarToggler />
				<BarBrand>
					<BarItem>
						<BarLink To="">
							<BarIcon IconName="_customIcon" />
							Weather Now
						</BarLink>
					</BarItem>
				</BarBrand>
				<NavMenu />
			</Bar>
		</LayoutSiderContent>
	</LayoutSider>

	<Layout>
		<LayoutHeader Fixed="true">
			<Bar @bind-Visible="@_topbarVisible" Breakpoint="Breakpoint.Desktop" Background="Background.Primary" ThemeContrast="ThemeContrast.Light">
				<BarBrand>
					<BarItem>
						<BarLink To="">
							<BarIcon IconName="FontAwesomeIcons.CloudSun" />
							Weather Now
						</BarLink>
					</BarItem>
				</BarBrand>
				<BarMenu Class="justify-content-end">
					<BarEnd>
						<AuthorizeView>
							<Authorized>
								<BarItem>
									<Blazorise.Icon Name="FontAwesomeIcons.User" Visibility="Visibility.Visible" />
									Hi, @context?.User?.Identity?.Name
								</BarItem>
							</Authorized>
						</AuthorizeView>
						<BarItem>
							<LoginDisplay />
						</BarItem>
					</BarEnd>
				</BarMenu>
			</Bar>
		</LayoutHeader>

		<LayoutContent Padding="Padding.Is4.OnX">
			@Body
		</LayoutContent>

		<LayoutFooter Fixed="true" Padding="Padding.Is4.OnX">
			Copyright ©@DateTimeOffset.UtcNow.Year Inner Drive Technology.
		</LayoutFooter>
	</Layout>
</Layout>

The issue is that when a logged-in user views a page, they see the part within the <LayoutSider> tag, which includes the navigation menu. When an anonymous user hits the page, they don't see anything in that area.

The culprit turns out to be the <Bar Mode=""> attribute. If that attribute is present with any value at all, the behavior occurs. Without that value, the behavior does not occur.

One more data point: the Program.cs startup code contains this bit:

builder.Services.AddRazorPages(options =>
{
	options.Conventions.AllowAnonymousToFolder("/");
	options.Conventions.AllowAnonymousToPage("/Index");
	options.Conventions.AllowAnonymousToFolder("/_content");
	options.Conventions.AllowAnonymousToFolder("/Pages");
	options.Conventions.AllowAnonymousToFolder("/Shared");
});

That code lets anonymous users see any content in the app that doesn't specifically require being logged in or authorized.

Anyway, I hope someone in the 'verse sees one of these posts and knows what has gone wrong. (If you do, please comment on the Stack Overflow post so we both get reputation points.)

Backlog

I just started Sprint 52 in my day job, after working right up to the last possible minute yesterday to (unsuccessfully) finish one more story before ending Sprint 51. Then I went to a 3-hour movie that you absolutely must see.

Consequently a few things have backed up over at Inner Drive Technology World Headquarters.

Before I get into that, take a look at this:

That 17.1°C reading at IDTWHQ comes in a shade lower than the official reading at O'Hare of 17.8°, which ties the record high maximum set in 1971. The forecast says it'll hang out here for a few hours before gale-force winds drive the temperature down to more seasonal levels overnight. I've even opened a few windows.

So what else is new?

So what really is new?

But Sprint 52 at my office, that's incredibly new, and I must go back to it.

Come on, Xfinity

I've had intermittent Internet all morning for no reason that Comcast/Xfinity can tell me. Everything I do professionally requires an Internet connection.

I am displeased.

Coding on a winter afternoon

I've finally resumed progress on a major update to Weather Now. I finished everything except the user interface way back in April, but between summer, Cassie, and everything else, I paused.

At least, until last week, when something clicked in my head, and I started writing again. As my dad would say, I broke the code's back.

It turns out, the APIs really work well, and I'm getting used to .NET Blazor, so I'm actually getting things done. The only downside applies to Cassie, who will probably only get 90 minutes of walks today instead of the two hours or so she got on summer Saturdays.

Spicy poké

I swear, the local poké place used three shots of chili oil instead of one today. Whew. (Not that I'm complaining, of course.)

While my mouth slowly incinerates, I'm reading these:

On that last point, comedians Jimmy Carr and Emil Wakim lay down epic burns against anti-vaxxers:

Lunchtime links

We've just completed Sprint 50 at my day job, which included upgrading our codebase to .NET 6 and adding a much-desired feature to our administration tools. Plus, we wrote code to analyze 500,000 emails from a public dataset for stress testing one of our product's features. Not bad for a six-day sprint.

The sun is out, and while I don't hear a lot of birds singing, I do see a lot of squirrels gathering walnuts from the tree across the street. It's also an unseasonably warm 7°C at Inner Drive Technology World Headquarters, going up to 10°C today and 12°C by Thursday. So Cassie and I will head to the dog park in just a few minutes.

First, though, just a couple things of note:

And with that, Cassie has some running around to do.

Overdue shifting of externalities in the UK

Fed up with manufacturers releasing Internet-connected products for the home with inadequate security that puts everyone in the world at risk, the UK has finally cracked down:

Default passwords for internet-connected devices will be banned, and firms which do not comply will face huge fines.

The Product Security and Telecommunications Infrastructure Bill lays out three new rules:

  • easy-to-guess default passwords preloaded on devices are banned. All products now need unique passwords that cannot be reset to factory default
  • customers must be told when they buy a device the minimum time it will receive vital security updates and patches. If a product doesn't get either, that must also be disclosed
  • security researchers will be given a public point of contact to point out flaws and bugs

The new regime will be overseen by a regulator, which will be appointed once the bill comes into force. It will have the power to fine companies up to £10m [$1.3m] or 4% of their global turnover, as well as up to £20,000 [$26,700] a day for ongoing contraventions.

About bloody time, I say. Yes, people should know better than to connect open Internet ports to their home networks, but most people in the world do not understand what any of that means. We don't make people mix their gasoline with air when driving anymore for the same reasons.

Productive day so far

Having a day off with no real responsibilities gives me the space to take care of some niggling projects I've put off for a while. First, I finished updating a document for the Apollo Chorus that lists every sit and stand cue and every score marking for our Messiah performances. That took about 8 hours altogether.

I also updated my main NuGet packages to .NET 6. As a nice bonus, because of a quirk in how .NET assemblies get versioned, today's release is version 4.2.8000. (I kept the previous release active just in case someone needs it for an existing .NET 5 project.)

Oh, and I've got a pot of stew going that should finish in about an hour. I made a lot of it. I hope it freezes all right. Good thing I have tons of Mason jars. It looked like this at 3½ hours:

Short-term license agreements

Today is the 50th anniversary of DB Cooper jumping out of a hijacked airplane into the wilds of Washington State. It's also the day I will try to get a Covid-19 booster shot, since I have nothing scheduled for tomorrow that I'd have to cancel if I wind up sleeping all day while my immune system tries to beat the crap out of some spike proteins in my arm.

Meanwhile, for reasons passing understanding (at least if you have a good grasp of economics), President Biden's approval ratings have declined even though last week had fewer new unemployment claims than any week in my lifetime. (He's still more popular than the last guy, though.)

In other news:

Any moment now, my third DevOps build in the last hour will complete. I've had to run all three builds with full tests because I don't always write perfect code the first time. But this is exactly why I have a DevOps build pipeline with lots of tests.

The busy season

I've spent today alternately upgrading my code base for my real job to .NET 6.0, and preparing for the Apollo Chorus performances of Händel's Messiah on December 11th and 12th.

Cassie, for her part, enjoys when I work from home, even if we haven't spent a lot of time outside today because (a) I've had a lot to do and (b) it rained from 11am to just about now.

So, as I wait for the .NET 6 update to build and deploy on our dev/test CI/CD instance (I think I set the new environments on our app services correctly), I have a few things to read:

OK, the build has...well, crap. I didn't set the environment correctly after all.

Update: Fixed the build bit. And the rain stopped. But the test platform is the wrong version. FFS.

Update: Well, I have to pick something up from a store before 6, so I'll come back to this task later.

Update: Even though I've had 4 tiny commits of minor things that broke with the .NET 6 upgrade, this hasn't gone poorly. Kudos to Microsoft for providing a straightforward upgrade path.