Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FIX] Seconds not properly prevented from being negative #1310

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

Open
olfek wants to merge 6 commits into Authenticator-Extension:dev
base: dev
Choose a base branch
Loading
from olfek:patch-1

Conversation

Copy link

@olfek olfek commented Sep 17, 2024

The current code ...

second += Number(UserSettings.items.offset) + 60;

... fails in these two examples:

0 - 61 + 60 < 0
59 - 120 + 60 < 0

The offset (middle value) can be as low as -300.

if (Math.abs(offset) <= 300) {

So the least you can have is -241 (59 - 300), the + 60 is not enough to make a positive number.


Without this fix, in the examples given above, the effect will be:

Countdown circle animation may be out of sync with the current time step because animationDelay will be stuck at 0s.

<svg viewBox="0 0 16 16">
<circle
cx="8"
cy="8"
r="4"
v-bind:style="{
animationDuration: entry.period + 's',
animationDelay: (sectorOffset % entry.period) + 's',

timeout class will never activate unless entry.period < 5 because the left side of the < condition will be stuck at entry.period.

timeout: entry.period - (second % entry.period) < 5,

Copy link
Author

olfek commented Sep 17, 2024

Requesting review @Sneezry @mymindstorm

Copy link
Member

It's on my to-do list, but might take me a while to get to this

olfek reacted with thumbs up emoji

Copy link
Author

olfek commented Oct 4, 2024

🛎️🛎️🛎️ @Sneezry @mymindstorm

Copy link
Author

olfek commented Oct 19, 2024

@mymindstorm 📟📟📟

Copy link
Member

@mymindstorm mymindstorm left a comment

Choose a reason for hiding this comment

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

Thanks for your patience. Slight nitpicks, but otherwise good catch!

Co-authored-by: Brendan Early <mymindstorm@evermiss.net>
Copy link
Member

It looks like I don't have permission to push to your branch to fix the lint issues.

image

Copy link
Author

olfek commented Oct 21, 2024

@mymindstorm I've added you as a collaborator.

Copy link
Author

olfek commented Oct 21, 2024

FYI, I've never been a fan of prettier, it's too opinionated. The actual code is important, how it's formatted can always be corrected later.

Copy link
Author

olfek commented Oct 23, 2024

@mymindstorm I think we're good to go here

Copy link
Author

olfek commented Oct 23, 2024

@mymindstorm ...

After running prettier with the --write option, I get this from git diff --stat :

 src/store/Accounts.ts | 79 +++++++++++++++++++++++++--------------------------
 1 file changed, 38 insertions(+), 41 deletions(-)

Would you like me to commit this? - It will pollute the PR diff a little, I await your decision.

Copy link
Member

That doesn't seem right, have you tried running npm run chrome? It will automatically format it using our configs.

Copy link
Author

olfek commented Oct 23, 2024

@mymindstorm You have collaborator access to my fork, can you take over from here?

Copy link
Author

olfek commented Oct 23, 2024

@mymindstorm ...

That doesn't seem right, have you tried running npm run chrome? It will automatically format it using our configs.

I don't think you have any prettier configs (https://prettier.io/docs/en/configuration)

Copy link
Member

When you use prettier outright instead of through npm run, depending on how your system is configured it might use a different version which may have different rules.

Copy link
Member

I'll get to this when I can just am extremely busy.

Copy link
Author

olfek commented Oct 23, 2024

@mymindstorm ...

When you use prettier outright instead of through npm run, depending on how your system is configured it might use a different version which may have different rules.

https://prettier.io/docs/en/configuration says

Prettier intentionally doesn’t support any kind of global configuration. This is to make sure that when a project is copied to another computer, Prettier’s behavior stays the same. Otherwise, Prettier wouldn’t be able to guarantee that everybody in a team gets the same consistent results.

Copy link
Author

olfek commented Oct 23, 2024

@mymindstorm ...

I propose temporarily (or permanently?) suspending the Prettier CI step until you set up a config file.

Copy link
Author

olfek commented Nov 8, 2024
edited
Loading

@mymindstorm ...

After running prettier with the --write option, I get this from git diff --stat :

 src/store/Accounts.ts | 79 +++++++++++++++++++++++++--------------------------
 1 file changed, 38 insertions(+), 41 deletions(-)

Would you like me to commit this? - It will pollute the PR diff a little, I await your decision.

@mymindstorm ...

So ... I was getting a big diff because I was using npx to run prettier like this:

npx prettier --check ./src/* ./src/**/* ./src/**/**/* ./sass/*.scss

... without running npm install, meaning the latest version of prettier (3.3.3) was being used instead of the package.json declared 2.2.1.

The default rules have changed since 2.2.1. See:

https://github.com/prettier/prettier/blob/2.2.1/src/language-js/options.js
https://github.com/prettier/prettier/blob/3.3.3/src/language-js/options.js

https://github.com/prettier/prettier/blob/2.2.1/src/main/core-options.js
https://github.com/prettier/prettier/blob/3.3.3/src/main/core-options.evaluate.js

Copy link
Author

olfek commented Nov 8, 2024

@mymindstorm Can you run CI again?

Copy link
Author

olfek commented Nov 18, 2024

@mymindstorm 📣📣📣

Copy link
Author

olfek commented Dec 1, 2024

@mymindstorm If you're too busy to work on this project, you think maybe it's time to pass it on to someone who can?

Copy link
Member

mymindstorm commented Dec 2, 2024
edited
Loading

@mymindstorm If you're too busy to work on this project, you think maybe it's time to pass it on to someone who can?

Given the sensitive nature of this project, we aren't going to take into account external calls for new maintainers. We don't want to be the next xz.

Life happens and circumstances require me to put Authenticator on hold outside of high urgency tasks. We appreciate your contributions, and we're working to get them merged as soon as we can.

Copy link
Author

olfek commented Dec 2, 2024

@mymindstorm

That was an interesting read, I didn't know about it, but with all due respect, there are probably more good cases of handing over the reins than bad, and the potential risks in unmaintained security software has far greater odds I would guess.

Copy link
Author

olfek commented Mar 13, 2025

@mymindstorm @Sneezry 🔔 🔔 🔔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mymindstorm mymindstorm mymindstorm approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /