Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make WAF workaround opt-in for now #5038

Merged
merged 8 commits into from
Oct 28, 2020
Merged

Conversation

swissspidy
Copy link
Collaborator

Summary

Turns out the mbstring polyfill we include is UTF-8 centric and not suitable for the UTF-16 conversion we are doing. That's why this decoding currently silently fails (i.e. leaves the string unchanged) when the native mbstring extension is not available (which can be the case on some systems).

For this reason, I am putting this behind a feature flag for now until this edge case is addressed.

Note: the mbstring polyfill is still needed because we need UTF-8 conversion for the AMP output on the frontend.

Relevant Technical Choices

To-do

  • Remove flag once stable

User-facing changes

N/A

Testing Instructions

Verify that encoding only happens when feature flag is turned on.

The decoding always happens.


See #4805

@swissspidy swissspidy added Type: Bug Something isn't working P0 Critical, drop everything Group: Integration Integration with other platforms and plugins Group: WordPress Changes related to WordPress or Gutenberg integration Pod: WP & Infra labels Oct 28, 2020
@google-cla google-cla bot added the cla: yes label Oct 28, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2020

Size Change: 0 B

Total Size: 1.4 MB

ℹ️ View Unchanged
Filename Size Change
assets/css/edit-story.css 909 B 0 B
assets/css/stories-dashboard.css 939 B 0 B
assets/css/web-stories-embed-block.css 515 B 0 B
assets/js/chunk-fonts-********************.js 43.7 kB 0 B
assets/js/chunk-web-stories-template-0-********************.js 10.2 kB 0 B
assets/js/chunk-web-stories-template-1-********************.js 10.2 kB 0 B
assets/js/chunk-web-stories-template-2-********************.js 9.97 kB 0 B
assets/js/chunk-web-stories-template-3-********************.js 10.5 kB 0 B
assets/js/chunk-web-stories-template-4-********************.js 10.6 kB 0 B
assets/js/chunk-web-stories-template-5-********************.js 6.83 kB 0 B
assets/js/chunk-web-stories-template-6-********************.js 9.87 kB 0 B
assets/js/chunk-web-stories-template-7-********************.js 9.75 kB 0 B
assets/js/chunk-web-stories-textset-0-********************.js 5.25 kB 0 B
assets/js/chunk-web-stories-textset-1-********************.js 6.58 kB 0 B
assets/js/chunk-web-stories-textset-2-********************.js 7.83 kB 0 B
assets/js/chunk-web-stories-textset-3-********************.js 15.2 kB 0 B
assets/js/chunk-web-stories-textset-4-********************.js 4.38 kB 0 B
assets/js/chunk-web-stories-textset-5-********************.js 5.68 kB 0 B
assets/js/chunk-web-stories-textset-6-********************.js 5.47 kB 0 B
assets/js/chunk-web-stories-textset-7-********************.js 10.3 kB 0 B
assets/js/edit-story.js 528 kB 0 B
assets/js/stories-dashboard.js 593 kB 0 B
assets/js/web-stories-activation-notice.js 74.1 kB 0 B
assets/js/web-stories-embed-block.js 17.5 kB 0 B

compressed-size-action

@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #5038 into main will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5038      +/-   ##
==========================================
- Coverage   75.80%   75.78%   -0.03%     
==========================================
  Files         921      921              
  Lines       16307    16316       +9     
==========================================
+ Hits        12362    12365       +3     
- Misses       3945     3951       +6     
Flag Coverage Δ
#karmatests 52.35% <ø> (-0.04%) ⬇️
#unittests 65.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
includes/Dashboard.php 35.48% <0.00%> (-0.29%) ⬇️
includes/REST_API/Stories_Base_Controller.php 40.98% <50.00%> (-0.69%) ⬇️
includes/Decoder.php 77.77% <60.00%> (ø)
includes/Experiments.php 97.41% <100.00%> (+0.09%) ⬆️
includes/Story_Post_Type.php 80.84% <100.00%> (+0.06%) ⬆️
.../src/edit-story/components/canvas/useCanvasKeys.js 52.45% <0.00%> (-6.56%) ⬇️

Copy link
Contributor

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. We have great options for refactoring later.

@swissspidy swissspidy merged commit 12ce5d1 into main Oct 28, 2020
@swissspidy swissspidy deleted the fix/decoder-feature-flag branch October 28, 2020 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: Integration Integration with other platforms and plugins Group: WordPress Changes related to WordPress or Gutenberg integration P0 Critical, drop everything Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants