Skip to content

fix: reminder question time elapsed#17774

Closed
gayatriii0803 wants to merge 1 commit intoankidroid:mainfrom
gayatriii0803:reminder
Closed

fix: reminder question time elapsed#17774
gayatriii0803 wants to merge 1 commit intoankidroid:mainfrom
gayatriii0803:reminder

Conversation

@gayatriii0803
Copy link
Copy Markdown
Contributor

Purpose / Description

Auto Advance "Question time elapsed" reminder does not work

Fixes

Approach

show snackbar on automaticShowAnswer()

How Has This Been Tested?

Physical device (OPPO F21 Pro 5G).

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Jan 9, 2025
@gayatriii0803
Copy link
Copy Markdown
Contributor Author

I don't understand why this fails. Is this related to my code?

@mikehardy
Copy link
Copy Markdown
Member

@gayatriii0803 failure most likely unrelated:

Triggered via pull request 11 hours ago

image

Github blew up

https://www.githubstatus.com/incidents/l76qh74ryp16

image

@mikehardy mikehardy closed this Jan 9, 2025
@mikehardy mikehardy reopened this Jan 9, 2025
@mikehardy
Copy link
Copy Markdown
Member

Closing and reopening forces a CI re-run.

david-allison

This comment was marked as resolved.

@david-allison david-allison added Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels Jan 10, 2025
Copy link
Copy Markdown
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

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

Lint and tests are failing

@BrayanDSO BrayanDSO added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Jan 10, 2025
@gayatriii0803
Copy link
Copy Markdown
Contributor Author

AutomaticAnswerActionTest > testExecute FAILED
    java.lang.UnsatisfiedLinkError: 'byte[][] net.ankiweb.rsdroid.NativeMethods.openBackend(byte[])'
        at net.ankiweb.rsdroid.NativeMethods.openBackend(Native Method)
        at net.ankiweb.rsdroid.Backend.<init>(Backend.kt:79)
        at net.ankiweb.rsdroid.BackendFactory.getBackend(BackendFactory.kt:39)
        at net.ankiweb.rsdroid.BackendFactory.getBackend$default(BackendFactory.kt:35)
        at com.ichi2.anki.CollectionManager.ensureBackendInner(CollectionManager.kt:208)
        at com.ichi2.anki.CollectionManager.access$ensureBackendInner(CollectionManager.kt:41)
        at com.ichi2.anki.CollectionManager$getBackend$1.invokeSuspend$lambda$0(CollectionManager.kt:153)
        at com.ichi2.anki.CollectionManager$withQueue$3.invokeSuspend(CollectionManager.kt:105)
        at _COROUTINE._BOUNDARY._(CoroutineDebugging.kt:42)
        at com.ichi2.anki.CollectionManager$getBackend$1.invokeSuspend(CollectionManager.kt:153)

Can anyone help me here?

@mikehardy
Copy link
Copy Markdown
Member

@david-allison - the test using TR.... which means it needs the backend. Is @JvmTest the correct inheritance there? Or should it be `RobolectricTest ?

@david-allison
Copy link
Copy Markdown
Member

JVM - the backend shouldn't need an Android dependency

@github-actions
Copy link
Copy Markdown
Contributor

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Jan 24, 2025
@github-actions github-actions bot closed this Jan 31, 2025
@sanjaysargam sanjaysargam reopened this Feb 4, 2025
@github-actions github-actions bot removed the Stale label Feb 4, 2025
@sanjaysargam sanjaysargam added Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels Feb 4, 2025
@Test
fun fromPreferenceValue() {
@RunWith(AndroidJUnit4::class)
class AutomaticAnswerActionTest : RobolectricTest() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do you need robolectric here? You can use a generic message instead of TR. below

@BrayanDSO BrayanDSO added the Needs Author Reply Waiting for a reply from the original author label Feb 7, 2025
@BrayanDSO BrayanDSO added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author Needs Review labels Feb 8, 2025
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

I don't understand the context of the bug from this PR

Could the commit message be updated to give a very brief explanation of the issue and the fix

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Feb 8, 2025
Copy link
Copy Markdown
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

seems like it's good to go but agreed, the PR description doesn't really say why it wasn't working before and why the PR fixes it, and the comment doesn't either.

Both should have some sort of <feature> wasn't working because of <reason>, this PR solves it by <approach> so that future people know what is going on

I can't really merge it without feeling like I know what is going on

Copy link
Copy Markdown
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

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

I tested that on the new reviewer instead of the old one 🙈, and I already added that reminder since the implementation of Auto Advance there. Shame on me.

Your PR mistakenly uses the same action of the answer

@BrayanDSO BrayanDSO removed the Needs Second Approval Has one approval, one more approval to merge label Feb 10, 2025
@gayatriii0803 gayatriii0803 force-pushed the reminder branch 2 times, most recently from 9fc8155 to c58c164 Compare February 19, 2025 06:56
@sanjaysargam sanjaysargam added Needs Review and removed Needs Author Reply Waiting for a reply from the original author Has Conflicts labels Feb 20, 2025
Comment on lines +33 to +35
fun execute(reviewer: Reviewer) {
val action = this.toCommand()
if (action != null) {
Timber.i("Executing %s", action)
reviewer.executeCommand(action)
} else {
reviewer.showSnackbar(TR.studyingQuestionTimeElapsed())
}
}

/** Convert to a [ViewerCommand] */
private fun toCommand(): ViewerCommand? =
when (this) {
SHOW_ANSWER -> ViewerCommand.SHOW_ANSWER
SHOW_REMINDER -> null
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this couples the class to the old reviewer, which is bad by itself as code design, and the old reviewer will be removed eventually. Please do these changes on Reviewer or extensions methods there, but not here.

@BrayanDSO BrayanDSO added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Feb 20, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2025

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Apr 1, 2025
@github-actions github-actions bot closed this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Has Conflicts Needs Author Reply Waiting for a reply from the original author Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto Advance "Question time elapsed" reminder does not work

6 participants