-
Notifications
You must be signed in to change notification settings - Fork 92
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
fix dedup logs #977
fix dedup logs #977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions about the variable initialization
lastLogLineCheckedTimestamp, | ||
lastLogLineCheckedIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't cause issue if it's not initialized ?
lastLogLineCheckedIndex: number, | ||
): string[] { | ||
if (!lastLogLineCheckedTimestamp) return logs; | ||
if (useIndex) return logs.slice(lastLogLineCheckedIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, lastLogLineCheckedIndex is undefined when entering the above loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, those two variables work in tandem to represent the different providers features. The invariant here is that lastLogLineCheckedIndex
will be undefined at the same time that lastLogLineCheckedTimestamp
is undefinded, so the this if (https://github.com/paritytech/zombienet/pull/977/files#diff-fc4624d6bb61da0712b154b5018f73681adaf8edadb4236a0b5293ea915ef41eR549) cover this case.
I think there is room to improving here, but we can do it in a follow up pr.
Thanks!
Fixes #580
And our current CI.