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

Opportunity to reduce amount of information transferred between client and server #1203

Closed
AlexeySachkov opened this issue Jan 23, 2021 · 1 comment

Comments

@AlexeySachkov
Copy link
Member

I've been writing some tests for /api POST route and I discovered that in response to newly created homebrewery document, server sends its gzip-ed content back to the client as well as the rest of metadata. However in newPage we immediately redirect user to edit page without even using this information:

request.post('/api')
.send(_.merge({}, this.state.metadata, {
text : this.state.text
}))
.end((err, res)=>{
if(err){
this.setState({
isSaving : false
});
return;
}
window.onbeforeunload = function(){};
const brew = res.body;
localStorage.removeItem(KEY);
window.location = `/edit/${brew.editId}`;
});

I don't think that this is an issue with huge impact, because most likely users press save on new brew page earlier than entering a lot of content in there, but still it makes sense to clean up our code

@5e-Cleric
Copy link
Member

Given that we want to merge new and edit, i'd say this should keep sending the brew back. Keeping it for when we finally merge the two.

Linking #1800 as it tracks the unification of the two pages. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants