ultimate_alarm_clock icon indicating copy to clipboard operation
ultimate_alarm_clock copied to clipboard

Bug: In updateAlarmProfiles function, currentProfile variable not utilized in logic

Open abhivyakti2 opened this issue 1 year ago • 4 comments

Description

Title: Refactor and Improve Usage of currentProfile in Alarm Profile Update Logic

Description:

I would like to raise an issue regarding the current implementation of the currentProfile variable in the alarm profile update logic. In updateAlarmProfiles, currentProfileName is fetched using storage.readProfile() and is used directly to filter alarms for updating. However, the variable currentProfile is declared using IsarDb.getProfile(currentProfileName) but is not utilized anywhere in the function. This creates unnecessary ambiguity and potential redundancy.

Suggested Solution:

  • Refactor the function to use currentProfile to validate the existence of the profile before proceeding with updates.

Impact:

  • Leaving unused or redundant variables in the codebase reduces maintainability and introduces unnecessary complexity. Ensuring clarity in the logic for updating alarm profiles will improve the quality of the code.

Request:

I would like to request the maintainers to assign this issue to me. I can work on refactoring this function to ensure a cleaner and more consistent implementation.

Thank you for your time and consideration!

Screenshots

Image

abhivyakti2 avatar Feb 12 '25 11:02 abhivyakti2

Hi @abhivyakti2 ,

I’d like to fix Bug #673 by refactoring updateAlarmProfiles to utilize currentProfile properly. Can you please assign this to me? Thanks!

Best,

jyotiraditya-chauhan avatar Mar 01 '25 09:03 jyotiraditya-chauhan

I have assigned this issue to you, you can refactor it. @abhivyakti2

MarkisDev avatar Mar 01 '25 14:03 MarkisDev

@abhivyakti2 have you solved this issue yet ? If not I can solve this issue.

VatsalJain2004 avatar Mar 27 '25 06:03 VatsalJain2004

@MarkisDev what is the status of this bug ? I want to work on it , please assign this to me .

Anuj-Bhandari avatar Nov 07 '25 10:11 Anuj-Bhandari