Skip to content

fix: local date reg info for new accounts - #193

Merged
omg-xtao merged 1 commit into
NextAlone:devfrom
waifucon:fix-date-reg-new-accs
Oct 5, 2026
Merged

omg-xtao merged 1 commit into
NextAlone:devfrom
waifucon:fix-date-reg-new-accs

Conversation

@waifucon

@waifucon waifucon commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

reported by nextalone in an nnngram pr: NextAlone/Nnngram#110 (comment)

dropped an hardcoded value.

before:
image

now:
image

Summary by Sourcery

Bug Fixes:

  • Use the configured profile-date range when displaying registration information for new and legacy accounts instead of fixed timestamps.

@sourcery-ai

sourcery-ai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Fixes local registration-date estimation for new accounts by basing boundary fallbacks on the loaded profile date range, keeping IDs and timestamps synchronized with the current data.

Flow diagram for profile registration date estimation

flowchart TD
    A[getUserTime userId] --> B{Matching profile date found?}
    B -->|Yes| C[getUserTime with matched date]
    B -->|No| D{userId <= first profile ID?}
    D -->|Yes| E[getUserTime with first profile date]
    D -->|No| F[getUserTime with last profile date]
Loading

File-Level Changes

Change Details Files
Derive fallback registration dates from the profile date data instead of hard-coded IDs and timestamps.
  • Use the first profile-date record’s ID and date for lower-bound users.
  • Use the last profile-date record’s date for upper-bound users.
TMessagesProj/src/main/java/tw/nekomimi/nekogram/helpers/ProfileDateHelper.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="TMessagesProj/src/main/java/tw/nekomimi/nekogram/helpers/ProfileDateHelper.java" line_range="72" />
<code_context>
                 return getUserTime("~", dateLong);
             }
         }
-        if (userId <= 1000000) {
</code_context>
<issue_to_address>
**issue (bug_risk):** Accounts with IDs above the final JSON entry are displayed as registered after August 2025, because the final entry has date 1755628800 even though an earlier entry has the later date 1764979200. The fallback therefore does not use the latest available profile registration date for new accounts.

**Triggers:** When the account ID is greater than 8461412540.

**Suggested fix:** Use the entry with the maximum registration date for the upper-bound fallback, or ensure the profile data is ordered by date before selecting the final element.

```suggestion
        long latestDate = profileDateDataList.get(0).getDate();
        for (ProfileDateData data : profileDateDataList) {
            if (data.getDate() > latestDate) {
                latestDate = data.getDate();
            }
        }
        return getUserTime(">", latestDate * 1000L);
```
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: TMessagesProj/src/main/java/tw/nekomimi/nekogram/helpers/ProfileDateHelper.java:72


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@waifucon
waifucon force-pushed the fix-date-reg-new-accs branch from c533014 to 5bd8a51 Compare October 4, 2026 15:31
@omg-xtao omg-xtao added the bug Something isn't working label Oct 5, 2026
@omg-xtao
omg-xtao merged commit 29720dc into NextAlone:dev Oct 5, 2026
3 checks passed
@waifucon
waifucon deleted the fix-date-reg-new-accs branch October 5, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants