kaberett: A sleeping koalasheep (Avatar: the Last Airbender), with the dreamwidth logo above. (dreamkoalasheep)
kaberett ([personal profile] kaberett) wrote in [site community profile] dw_dev2017-01-28 04:07 pm
Entry tags:

Code tour: 2016-12-17 to 2017-01-28

CODE TOUR. This time I didn't get sucked into six months of endless labwork never to be seen again. Have fun.

Issue 1334: enable Cyrillic in site search (pull request)
Category:
Patch by: [github.com profile] alierak
Description: A much-requested feature -- which turned out to be an encoding issue. Because of course it did. Site search in Cyrillic should, as of the next code push, actually work.

Issue 1338: payment processor "duplicate transaction" response code not separate from "payment type not supported" response code (pull request)
Category:
Patch by: [github.com profile] kareila
Description: There are two very common ways for payments in the Dreamwidth shop to fail. One is a payment type failure (for example, using a credit card that isn't supported); the other happens when someone tries to make two very similar purchases as separate transactions, and the shop thinks this is a potential duplicate and refuses the payment for an hour or so. Unfortunately, both these failure cases gave the same error message -- and it's obviously pretty confusing to be told "payment type not supported" when you know perfectly well that it is because you just made a successful payment using that method. So the error codes have been separated out, and will now be rather more relevant!

Issue 1609: Drifting base layout always users 'topcomment' as the reply_container target so quickreply doesn't work on some pages
Category:
Patch by: [github.com profile] rshatch
Description: QuickReply is the thing that lets you respond to entries and comments on the entry page, rather than having to go via ?mode=reply. It's nice when it works. It was trying to show up, it just... unfortunately didn't have anything to stick to, so having made a brave attempt it sidled off feeling unloved. Now it has, to mix metaphors freely in a desperate attempt to get this code tour written before any more fixes land, somewhere to put roots -- so QuickReply will shortly work for all pages styled with Drifting.

Issue 1893: Practicality has incorrect propgroups (pull request)
Category:
Patch by: [github.com profile] rshatch
Description: ... which means that colours were getting sorted into two different 'colors' groups and 'misc', which in turn meant that developing new themes for the style was much harder and much more faff than it needed to be. Now it will be easier!

Issue 1896: notifyarchive table shouldn't be used if esn_archive is disabled (pull request)
Category:
Patch by: [github.com profile] kareila
Description: The notifyarchive table was taking up somewhere between 5 and 10% of Dreamwidth's database storage. The notifyarchive table exists purely to store the link saying "user X has notification Y and it's unread/read/whatever". It kept all of this information even for notifications you had already deleted from your inbox, despite the fact that it is not currently used anywhere at all. This was, to make a Terribly British Understatement, a suboptimal use of resources. Records of deleted notifications now get purged, and the database space can be used for something else.

Issue 1904: avoid proxy hanging, never return from handleProxyFileRequests (pull request)
Category:
Patch by: [github.com profile] alierak
Description: The proxy is supposed to be an infinite loop, handling requests until it dies. Mark worked on it during the hardware migration, and inadvertently made it return from the function with the loop, instead of continuing -- so the proxy was still running and managing things like robots.txt, which says whether search engines can index pages or files, but it wasn't able to actually retrieve cached files, which is a bit important. As a result, images weren't loading reliably: the proxy would get started, it would look like it was working for a bit, but gradually more and more images wouldn't load. This is Now Fixed, because it was a big enough problem that the change was made to the live code rather than waiting for a code push.

Issue 1909: error in stats/site (pull request)
Category:
Patch by: [github.com profile] kareila
Description: There was an issue that got fixed. A bit. Now it's been fixed some more, and tests actually work right: in many cases, for the purposes of computer, something that is undefined is treated as equivalent (I'm handwaving) to zero. You can, therefore, say "if THIS THING equals ZERO..." and continue merrily on your way. Unfortunately, Template Toolkit -- the set of tools DW is gradually migrating site-skinned pages over to being written in -- does... not treat the two as equivalent. Under these circumstances it helps to check both cases, i.e. is this thing zero OR is it undefined, so that you handle both rather than erroring out ungracefully and unhelpfully.

Issue 1917: Remove LJ::DBUtil (pull request)
Category:
Patch by: [github.com profile] kareila
Description: A bunch of backend site management was rearranged in a way I'm frankly incredibly fuzzy on, and as a result some code was no longer relevant. It is good practice to remove irrelevant code, because it makes it easier to understand what's happening and therefore much easier to keep everything updated and working as it should. By all means holler in comments if you'd like somebody with the relevant knowledge to explain this in more detail.

Issue 1923: Cleanup 2016q4 (pull request)
Category:
Patch by: [github.com profile] kareila
Description: [github.com profile] kareila does regular bits of cleanup on the codebase, to fix the sort of small niggling warnings that show up that one doesn't actually need to fix because nothing's broken but (a) it's tidier if you do and (b) it's less concerning and confusing to people who are not already familiar with the code's, ah, quirks. Things are now tidier.

Issue 1924: Safer payments (pull request)
Category:
Patch by: [github.com profile] zorkian
Description: Error-handling wasn't in the most sensible place, which meant that errors that arose while making payments sometimes failed in Mysterious Ways that were Very Difficult To Diagnose. This should make payments work more reliably, and make it easier to tell what's gone wrong if they still don't, which mostly just means people will have to open fewer "what on earth just happened?" support requests!

Issue 1925: add stats collection for resolve-extacct (pull request)
Category:
Patch by: [github.com profile] kareila
Description: You might remember that, a little while ago, Dreamwidth servers stopped sending e-mailed notifications -- which meant that no e-mail notifications of the support requests about this were going out either. Dreamwidth uses a service called Datadog to keep track of various aspects of site performance, including -- these days! -- how many e-mails are getting sent out. Okay. So: what resolve-extacct does is work out what kind of account an external account is, and records it for future use. The first time someone used the code <user name=news site=lj> on Dreamwidth, resolve-extacct went away and asked LiveJournal whether the account news was a person, community, or feed -- so the correct userhead can get used. If everything goes well, the external site's response is recorded, so it doesn't have to be looked up on any of the subsequent occasions that someone links to that account. If it doesn't work, it waits and tries again... which is absolutely fine, up until LiveJournal decides Dreamwidth is making too many requests of it (for example, due to a high rate of imports), and resolve-extacct requests pile up... and up... and up... and nobody noticed. WHAT THIS FIX DOES is make it so that if the requests do pile up high enough that you can't see over the top any more, an alarm goes off to point this out, so someone can take out the bins and everything will work more smoothly.


Issue 1926: Add HTTPS Everywhere beta (pull request)
Category:
Patch by: [github.com profile] zorkian
Description: DW has been gradually working on making it possible to enable HTTPS across the entire site by default, to make browsing more secure; currently it's the case that if you visit one HTTPS url the rest of the links you click from there will be HTTPSified, but as of the next code push you'll be able to opt in to having everything be HTTPS without needing to take that step!

Issue 1928: Error on /file/edit (pull request)
Category:
Patch by: [github.com profile] kareila
Description: In particular, if automatic resizing of a file during upload failed then... so would all future attempts to edit files. Kareila fixed this by (a) providing an actually useful error, and (b) rearranging things so that a failed upload wouldn't break /file/edit until cleared out by an admin. This will be Better than the current situation.

Issue 1929: remove references to unused comm_promo_list (pull request)
Category:
Patch by: [github.com profile] kareila
Description: Code machete! Unused code that was juuuust starting to be introduced to LiveJournal codebase when Dreamwidth forked, without any way for users to interact with it at all, that Dreamwidth has never used. Unused code makes the future a much more confusing place for everybody. This was not code that was going to get used by Dreamwidth. Shortly it will no longer exist.

Issue 1938: Remove flip-flop warnings from test suite (pull request)
Category:
Patch by: [github.com profile] kareila
Description: Tests are, as I keep telling y'all, a Great Good. Having test failures or warnings that do not reflect anything actually wrong with the code are a terrible idea because they prime everyone to just... ignore... errors and warnings. This makes a lot of people very unhappy, and is generally considered a bad idea. Consequently, when some tests started issuing irrelevant warnings after some changes elsewhere to the codebase, Kareila rewrote them so that they provided a more accurate reflection of reality, and stopped panicking about situations that were fine.

Issue 1947: remove unused module SixDegrees.pm (pull request)
Category:
Patch by: [github.com profile] kareila
Description: Code machete! The unused code goes In The Bin.

16 total issues resolved
Contributors: [github.com profile] alierak, [github.com profile] kareila, [github.com profile] rshatch, [github.com profile] zorkian