Testcafe-hammerhead: LocalStorage raises QuotaExceededError while using `castToString` in StorageWrapper

Created on 23 Jan 2018  路  9Comments  路  Source: DevExpress/testcafe-hammerhead

Within StorageWrapper (src/client/sandbox/storages/wrapper.js), the method castToString (line 160) is used to convert value to string. This uses the localStorage itself for the conversion. This fails with a QuotaExceededError if the localStorage already holds a lot of data.

As a result the amount of data that could be pushed into LocalStorage by the app reduces to half the browser's actual localStorage limit.

Moreover, we do not handle the error at this point, leading to a test case failure.

As a result, even when I am not hitting the theoretical limits of localStorage, the testcases fail for me with the QuotaExceededError

client level 2 Auto-locked storages bug

All 9 comments

Hi @anubhavsagar.
Thanks for your bug report.
Until the bug is fixed, you can try a temporary workaround.
In your fork, replace castToString(...) with String(...) in two places: https://github.com/DevExpress/testcafe-hammerhead/blob/3aacda98c9a589fe50871823e6d683ac25b9b6b1/src/client/sandbox/storages/wrapper.js#L182 https://github.com/DevExpress/testcafe-hammerhead/blob/3aacda98c9a589fe50871823e6d683ac25b9b6b1/src/client/sandbox/storages/wrapper.js#L229.
Then build your own version of hammerhead.js and put it to node_modules/testcafe-hammerhead/lib/client
Let me know about your result.

Is there a fix planned @LavrovArtem ? My team is seeing this issue as well.

This issue is in our plans, but we cannot provide any estimates at this time.

@LavrovArtem / @Dmitry-Ostashev , if we create a PR with the fix as laid out by @miherlosev (above) would you be willing to merge it in?

Hi @adewinter

Thank you for your desire to fix this issue. We've added this issue to the current development sprint. @LavrovArtem is working on it right now.

I'm working on it.

At present, the TODO list for the issue is:

I will close this issue since the original castToString issue was fixed. Also, I opened a new issue related to storages compression. You can track our progress here: https://github.com/DevExpress/testcafe-hammerhead/issues/2325.

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebokgabor84 picture sebokgabor84  路  8Comments

AndreyBelym picture AndreyBelym  路  5Comments

leiswatch picture leiswatch  路  4Comments

matthias-b picture matthias-b  路  8Comments

feikegeerts picture feikegeerts  路  3Comments