Skip to content

Conversation

@CommanderRoot
Copy link
Contributor

String.prototype.substr() is deprecated so we replace it with String.prototype.slice() which works similarily but isn't deprecated.
.substr() probably isn't going away anytime soon but the change is trivial so it doesn't hurt to do it.

@CarlSchwan
Copy link
Member

Thanks :)

@CarlSchwan
Copy link
Member

/compile amend /

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <[email protected]>
@CarlSchwan CarlSchwan merged commit 319c08e into nextcloud:master Apr 9, 2022
@nickvergessen
Copy link
Member

The app seems to break recently and this is the only change since 23 I found that could be related at all.
Ref #699

Can we revert it?

nickvergessen added a commit that referenced this pull request Apr 27, 2022
Signed-off-by: Joas Schilling <[email protected]>
@nickvergessen nickvergessen mentioned this pull request Apr 27, 2022
nextcloud-command pushed a commit that referenced this pull request Apr 27, 2022
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
nickvergessen added a commit that referenced this pull request Apr 27, 2022
backportbot-nextcloud bot pushed a commit that referenced this pull request Apr 27, 2022
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
nextcloud-command pushed a commit that referenced this pull request Apr 27, 2022
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@CommanderRoot
Copy link
Contributor Author

Did the revert fix the issue? I have re-checked the code in this PR and the only thing I could find which could result in a different output with .slice() instead of .substr() was on this line 319c08e#diff-a399f4f7618b3592834a1e57a93657c1618c0df173b27e903e5493a63e0a0853R37 if endPos is -1.
So replacing it with

const message = json.slice(startPos, endPos !== -1 ? endPos : 0);

would fix that as well.

@nickvergessen
Copy link
Member

The backport is still pending #704

nickvergessen added a commit that referenced this pull request Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants