Posts

Showing posts with the label bug

New blog domain: kula.blog

It's still work in progress but new posts will be published on  https://kula.blog/ Thanks to 11ty base blog RSS is working from the start so it should be easy to add to your reader if you still use any :) If now then I hope you can sign up to the newsletter where I'll be publishing new posts and interesting articles to it from time to time. Please use  kula.blog  from now on.

I've spent an hour debugging XSRF error because of ... fetch

Image
Photo by Tim Gouw from Pexels Yesterday we were working on a new subpage with a form. Let's use the new `fetch` API to make POST requests seemed like a good idea but we started getting errors from the server: ` HTTP 403: Forbidden (XSRF cookie does not match POST argument)` Header `X-XSRFToken ` was set, we tried passing value in the body, setting token in the template, setting it in the backend only in certain cases but nothing helped. Finally my coworker found out that we're not sending `_xsrf` cookie with the request at all so it generates a new one every time... Turns out fetch doesn't send cookies by default. It's by design:  https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch The fix is incredibly simple: tell fetch to include credentials in the options: ``` fetch("/someURL/", {     method: "post",     headers: {        "X-CSRFToken": token     },     credentials: "include" }); ...

Safari Mobile CSS VW and VH units bug.

Image
Recently we have created new version of mobil.aftenposten.no but soon after serving it to some users we spot this tweet:  https://twitter.com/Al3x4nd3rR/status/452047498111369216 . Basically titles were missing.... Then it started our effort to reproduce this bug. ... It was nightmare! First how to reproduce it: Open  http://krzychukula.github.io/vw_bfcache/  in Mobile Safari.  Click "Go to another page" link Leave phone for 60 seconds (longer is better) Click back button If you were lucky you should see some missing paragraphs and missing green boxes. How it looks: Bug: This one uses vw and vh for font-size. Both are 0 so we can see only 2 from 8 paragraphs. Those two are using only em for font-size. I was curious if it's only for font-size so I have added another test. I have added two boxes with width and height set in vw and vh with green background color. They parents have red background for contrast.  ...

Skype 4 installation on Ubuntu 12.04

Yesterday I tried to install Skype, but I have already installed one from Software Center (Skype 2.0) and installation of DEB file faild due to: (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 193346 files and directories currently installed.) Unpacking skype (from .../skype-ubuntu_4.0.0.7-1_amd64.deb) ... dpkg: error processing /home/kris/Downloads/skype-ubuntu_4.0.0.7-1_amd64. deb (--install): trying to overwrite '/etc/dbus-1/system.d/skype.conf', which is also in ...

To remember: IE cuts off html on JS errors

More reading:  http://www.sigsiu.net/forum/community-board-for-troubleshooting-problems/bottom-half-of-page-missing-when-viewed-in-ie8/