Skip to content

Commit

Permalink
Use batch update as default to catch overruns
Browse files Browse the repository at this point in the history
After 2 months of testing by devs that manually set the cookie, there
have been no reports of issues, so we'll turn it on as the default for
everyone. More details in original PR:

#167
  • Loading branch information
didoesdigital committed Aug 6, 2024
1 parent 0252a72 commit 32fa8d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,9 @@ class App extends Component {

updateMarkup(event) {
let actualText = event.target.value;
// TODO: remove cookie thing before merging
const batchUpdate = document.cookie.indexOf("batchUpdate=1")>=0;
// TODO: once we're happy that this will be the permanent new default behaviour, remove all the `batchUpdate`-specific branching code and tests:
// const batchUpdate = document.cookie.indexOf("batchUpdate=1")>=0;
const batchUpdate = true;
if(!batchUpdate) {
this.updateBufferSingle(actualText);
return;
Expand Down
8 changes: 5 additions & 3 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ describe(App, () => {
}
);
});
// Current behavior
it("accepts excess chars except for spaceAfterOutput", async () => {
// TODO: once we're happy that with the new behaviour as the permanent default, remove all the `batchUpdate`-specific branching code and tests:
xit("accepts excess chars except for spaceAfterOutput", async () => {
document.cookie = "batchUpdate=0";
// This user with spaceOff setting actually puts space after
const spBefore = spacePlacement === "spaceBeforeOutput" ? " " : "";
Expand Down Expand Up @@ -607,7 +607,9 @@ describe(App, () => {
beforeEach(async () => {
await loadPage(PAGES.partyTricks);
});
it.each([1, 0])("records interim strokes for correct phrase (batchUpdate=%s)", async (batchUpdate) => {
// TODO: once we're happy that this will be the permanent new default behaviour, remove all the `batchUpdate`-specific branching code and tests:
// it.each([1, 0])("records interim strokes for correct phrase (batchUpdate=%s)", async (batchUpdate) => {
it.each([1])("records interim strokes for correct phrase (batchUpdate=%s)", async (batchUpdate) => {
document.cookie = `batchUpdate=${batchUpdate}`;
const { spBefore, spAfter } = getSpacer(spacePlacement);
await typeIn(spBefore + "sigh" + spAfter);
Expand Down

0 comments on commit 32fa8d9

Please sign in to comment.