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

Add engagement flags #78

Merged
merged 6 commits into from
Jan 18, 2024
Merged

Add engagement flags #78

merged 6 commits into from
Jan 18, 2024

Conversation

richford
Copy link
Contributor

No description provided.

Comment on lines 215 to 223
const engagementObj = engagementFlags.reduce((acc: { [x: string]: unknown }, flag) => {
acc[flag] = true;
return acc;
}, {});

if (!this.aborted) {
return updateDoc(this.runRef, { engagementFlags: engagementObj, reliable: !markAsUnreliable });
} else {
throw new Error('Run has already been aborted.');
Copy link

Choose a reason for hiding this comment

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

i am not sure I follow this. what is engagementObj? can you explain it a bit? thanks!

Copy link

@AnyaWMa AnyaWMa left a comment

Choose a reason for hiding this comment

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

looks good to me!

Comment on lines +220 to +221
if (!this.aborted) {
return updateDoc(this.runRef, { engagementFlags: engagementObj, reliable: markAsReliable });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As it's written right now, this will overwrite any engagement flags that are already there. I think that might be okay but I just want to make sure that it's explicit. Can you add a comment to the docstring of both this method and the appkit method to let the user know that they will be overwriting any existing engagement flags for this run? It will then be the ROAR-app developer's responsibility to keep track of any previously assigned engagement flags.

@richford
Copy link
Contributor Author

Looks good to me. I made a small comment requesting docstring changes. But once that is done then this is good to go. Thanks @AnyaWMa and @lucasxsong!

@richford richford merged commit 2aa1861 into main Jan 18, 2024
4 checks passed
@richford richford deleted the enh/add-engagement-flags branch January 18, 2024 19:59
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