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

Fix #924 - some expiring domains not showing as expired #930

Merged
merged 10 commits into from
Dec 17, 2024

Conversation

emarc99
Copy link
Contributor

@emarc99 emarc99 commented Nov 28, 2024

Close #924

Summary by CodeRabbit

  • New Features

    • Enhanced wallet connection logic for the Argent mobile app.
    • Improved expiration status display for identities in the gallery.
  • Bug Fixes

    • Updated tooltip messages for expired and expiring domains in the identities gallery.
  • Chores

    • Added .env to the .gitignore file for better version control practices.
    • Reformatted licensing text for improved readability.

Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app-starknet-id ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 10:49am

Copy link

vercel bot commented Nov 28, 2024

@emarc99 is attempting to deploy a commit to the LFG Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Nov 28, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces changes to multiple components focusing on domain expiration handling and user interface improvements. The modifications include updating the .gitignore to exclude .env files, refining the Navbar and WalletConnect components, enhancing the IdentitiesGalleryV1 component's domain expiration warnings, and making minor formatting changes to a font license text file.

Changes

File Change Summary
.gitignore Added .env to ignored files
components/UI/navbar.tsx Updated href attribute to use template literal
components/UI/walletConnect.tsx Added isArgentMobile state and refined connector filtering logic
components/identities/identitiesGalleryV1.tsx Introduced isExpired and isExpiringSoon variables, updated domain expiration tooltip
public/fonts/poppins/OFL.txt Added line breaks for improved readability

Assessment against linked issues

Objective Addressed Explanation
Add warning label for expired domains [#924]
Distinguish between expired and expiring soon domains [#924]
Transform warning color to error for expired domains [#924]

Possibly related PRs

  • ref: identity warnings #887: The changes in this PR also involve the IdentitiesGalleryV1 component, which relates to the handling of warnings for expired domains, similar to the modifications made in the main PR regarding the .env file being ignored, as both involve domain validity and management.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4827c4 and c45853a.

📒 Files selected for processing (1)
  • components/UI/navbar.tsx (1 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (5)
components/UI/walletConnect.tsx (2)

36-39: Consider adding error handling

While the implementation is correct, consider adding try-catch to handle potential errors when checking for window.starknet_argentX.

 useEffect(() => {
-  if (typeof window !== "undefined")
-    setIsArgentMobile(isInArgentMobileAppBrowser());
+  if (typeof window !== "undefined") {
+    try {
+      setIsArgentMobile(isInArgentMobileAppBrowser());
+    } catch (error) {
+      console.error("Failed to detect Argent mobile browser:", error);
+      setIsArgentMobile(false);
+    }
+  }
 }, []);

105-113: Consider extracting the wallet name logic for better readability

While the implementation is correct, the wallet name logic could be extracted into a helper function for better readability.

+const getDisplayWalletName = (connector: Connector, isMobile: boolean, needInstall: boolean) => {
+  const prefix = needInstall ? "Install " : "";
+  const name = connector.id === "argentMobile" && isMobile
+    ? "Argent"
+    : getConnectorName(connector.id);
+  return `${prefix}${name}`;
+};

 <p>
-  {needInstall(connector, isAvailable) ? "Install " : ""}
-  {connector.id === "argentMobile" && isMobile
-    ? "Argent"
-    : getConnectorName(connector.id)}
+  {getDisplayWalletName(connector, isMobile, needInstall(connector, isAvailable))}
 </p>
components/identities/identitiesGalleryV1.tsx (1)

72-89: Consider enhancing the expired domain warning

While the current implementation meets the basic requirements, consider these enhancements to make the expired status more prominent:

  1. Add a visual "EXPIRED" badge or label next to the domain name
  2. Use a more prominent warning container instead of just an icon
  3. Add a direct "Renew" button in the warning

Example implementation:

 <div className={styles.expiryWarning}>
   <Tooltip
     title={
       isIdentityExpired(identity)
         ? "This domain has expired! Renew it now to keep using it."
         : `This domain will expire on ${timestampToReadableDate(identity?.domain_expiry ?? 0)}`
     }
     arrow
   >
     <div className={styles.warningContainer}>
       <RenewalIcon color={isIdentityExpired(identity) ? "#FF3333" : "#FFDE21"} width="12" />
+      {isIdentityExpired(identity) && (
+        <span className={styles.expiredBadge}>EXPIRED</span>
+      )}
+      {isIdentityExpired(identity) && (
+        <button
+          className={styles.renewButton}
+          onClick={(e) => {
+            e.stopPropagation();
+            router.push('/subscription');
+          }}
+        >
+          Renew
+        </button>
+      )}
     </div>
   </Tooltip>
 </div>

Add these CSS classes to your styles module:

.warningContainer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.expiredBadge {
  background: #FF3333;
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
}

.renewButton {
  background: #FF3333;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
🧰 Tools
🪛 Biome (1.9.4)

[error] 72-72: Expected an expression but instead found '<<'.

Expected an expression here.

(parse)


[error] 72-72: Expected an expression but instead found '<<'.

Expected an expression here.

(parse)


[error] 73-74: Expected a JSX attribute but instead found '? "This domain is expired"
: `'.

Expected a JSX attribute here.

(parse)


[error] 74-74: Expected a JSX attribute but instead found ', this'.

Expected a JSX attribute here.

(parse)


[error] 74-74: expected ... but instead found timestampToReadableDate

Remove timestampToReadableDate

(parse)


[error] 74-75: Expected an expression for the left hand side of the === operator.

This operator requires a left hand side value

(parse)


[error] 75-75: Expected an expression but instead found '==='.

Expected an expression here.

(parse)


[error] 75-75: Expected an expression but instead found '='.

Expected an expression here.

(parse)


[error] 74-75: Invalid assignment to ======

This expression cannot be assigned to

(parse)


[error] 76-76: Expected an expression, or an assignment but instead found '?'.

Expected an expression, or an assignment here.

(parse)


[error] 77-78: Expected an expression for the left hand side of the >>> operator.

This operator requires a left hand side value

(parse)


[error] 78-78: Expected an expression but instead found '>>>'.

Expected an expression here.

(parse)


[error] 78-78: Expected an expression but instead found '>'.

Expected an expression here.

(parse)


[error] 78-78: expected , but instead found :

Remove :

(parse)


[error] 79-79: expected , but instead found identity

Remove identity

(parse)


[error] 83-84: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.

Expected a JSX Expression, a Element, or a text here.

(parse)


[error] 85-85: expected , but instead found color

Remove color

(parse)


[error] 85-85: expected , but instead found =

Remove =

(parse)


[error] 85-86: Expected a JSX attribute but instead found '======='.

Expected a JSX attribute here.

(parse)


[error] 87-87: expected ... but instead found }

Remove }

(parse)


[error] 88-88: expected > but instead found <

Remove <

(parse)


[error] 84-87: Expected corresponding JSX closing tag for 'HEAD'.

Opening tag

closing tag

(parse)


[error] 72-83: Expected corresponding JSX closing tag for 'HEAD'.

Opening tag

closing tag

(parse)


[error] 88-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 74-75: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

utils/connectorWrapper.ts (2)

Line range hint 41-92: Add error handling for local storage operations.

The local storage operations in getLastConnector and getLastConnected should include try-catch blocks to handle potential errors.

Consider updating the implementation:

 export const getLastConnector = (): Connector | null => {
-  if (localStorage.getItem("SID-lastUsedConnector")) {
-    const connectordId = localStorage.getItem("SID-lastUsedConnector");
-    const connector = getConnectors().find((item) => item.id === connectordId);
-    return connector || null;
+  try {
+    const connectorId = localStorage.getItem("SID-lastUsedConnector");
+    if (!connectorId) return null;
+    return getConnectors().find((item) => item.id === connectorId) || null;
+  } catch (error) {
+    console.error("Error accessing localStorage:", error);
+    return null;
   }
-  return null;
 };

 export const getLastConnected = (): Connector | null => {
-  if (localStorage.getItem("SID-connectedWallet")) {
-    const connectordId = localStorage.getItem("SID-connectedWallet");
-    const connector = getConnectors().find((item) => item.id === connectordId);
-    return connector || null;
+  try {
+    const connectorId = localStorage.getItem("SID-connectedWallet");
+    if (!connectorId) return null;
+    return getConnectors().find((item) => item.id === connectorId) || null;
+  } catch (error) {
+    console.error("Error accessing localStorage:", error);
+    return null;
   }
-  return null;
 };

93-104: Improve type safety in the Argent mobile browser detection.

While the function works correctly, we can enhance type safety and readability.

Consider this improved implementation:

 export const isInArgentMobileAppBrowser = (): boolean => {
-  if (typeof window === "undefined" || !window?.starknet_argentX) {
+  if (typeof window === "undefined" || !window?.starknet_argentX || typeof window.starknet_argentX !== "object") {
     return false;
   }

-  const starknetMobile =
-    window?.starknet_argentX as unknown as StarknetWindowObject & {
-      isInAppBrowser: boolean;
-    };
+  interface ArgentMobileWindow extends StarknetWindowObject {
+    isInAppBrowser: boolean;
+  }
+
+  const starknetMobile = window.starknet_argentX as ArgentMobileWindow;

-  return starknetMobile?.isInAppBrowser;
+  return Boolean(starknetMobile?.isInAppBrowser);
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 32e55ae and c27edcd.

📒 Files selected for processing (6)
  • .gitignore (1 hunks)
  • components/UI/navbar.tsx (1 hunks)
  • components/UI/walletConnect.tsx (4 hunks)
  • components/identities/identitiesGalleryV1.tsx (1 hunks)
  • public/fonts/poppins/OFL.txt (1 hunks)
  • utils/connectorWrapper.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🧰 Additional context used
🪛 Biome (1.9.4)
components/UI/navbar.tsx

[error] 309-309: Expected a type parameter but instead found '<<<<<<'.

Expected a type parameter here.

(parse)


[error] 309-309: expected , but instead found HEAD

Remove HEAD

(parse)


[error] 310-310: expected , but instead found href

Remove href

(parse)


[error] 310-310: expected , but instead found =

Remove =

(parse)


[error] 310-310: expected , but instead found process

Remove process

(parse)


[error] 310-310: expected , but instead found as

Remove as

(parse)


[error] 310-310: expected , but instead found string

Remove string

(parse)


[error] 310-310: expected , but instead found }

Remove }

(parse)


[error] 310-311: expected , but instead found ===

Remove ===

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)

components/identities/identitiesGalleryV1.tsx

[error] 72-72: Expected an expression but instead found '<<'.

Expected an expression here.

(parse)


[error] 72-72: Expected an expression but instead found '<<'.

Expected an expression here.

(parse)


[error] 73-74: Expected a JSX attribute but instead found '? "This domain is expired"
: `'.

Expected a JSX attribute here.

(parse)


[error] 74-74: Expected a JSX attribute but instead found ', this'.

Expected a JSX attribute here.

(parse)


[error] 74-74: expected ... but instead found timestampToReadableDate

Remove timestampToReadableDate

(parse)


[error] 74-75: Expected an expression for the left hand side of the === operator.

This operator requires a left hand side value

(parse)


[error] 75-75: Expected an expression but instead found '==='.

Expected an expression here.

(parse)


[error] 75-75: Expected an expression but instead found '='.

Expected an expression here.

(parse)


[error] 74-75: Invalid assignment to ======

This expression cannot be assigned to

(parse)


[error] 76-76: Expected an expression, or an assignment but instead found '?'.

Expected an expression, or an assignment here.

(parse)


[error] 77-78: Expected an expression for the left hand side of the >>> operator.

This operator requires a left hand side value

(parse)


[error] 78-78: Expected an expression but instead found '>>>'.

Expected an expression here.

(parse)


[error] 78-78: Expected an expression but instead found '>'.

Expected an expression here.

(parse)


[error] 78-78: expected , but instead found :

Remove :

(parse)


[error] 79-79: expected , but instead found identity

Remove identity

(parse)


[error] 83-84: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.

Expected a JSX Expression, a Element, or a text here.

(parse)


[error] 85-85: expected , but instead found color

Remove color

(parse)


[error] 85-85: expected , but instead found =

Remove =

(parse)


[error] 85-86: Expected a JSX attribute but instead found '======='.

Expected a JSX attribute here.

(parse)


[error] 87-87: expected ... but instead found }

Remove }

(parse)


[error] 88-88: expected > but instead found <

Remove <

(parse)


[error] 84-87: Expected corresponding JSX closing tag for 'HEAD'.

Opening tag

closing tag

(parse)


[error] 72-83: Expected corresponding JSX closing tag for 'HEAD'.

Opening tag

closing tag

(parse)


[error] 88-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 74-75: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

🪛 LanguageTool
public/fonts/poppins/OFL.txt

[typographical] ~9-~9: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...------ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 -----------------------...

(DASH_RULE)

🔇 Additional comments (4)
components/UI/walletConnect.tsx (2)

1-1: LGTM! Clean implementation of state management

The addition of the Argent mobile detection state and its import follow React best practices.

Also applies to: 11-11, 29-29


Line range hint 41-47: Verify connector filtering behavior across different environments

The filtering logic looks correct, but let's verify its behavior across different environments and wallet configurations.

✅ Verification successful

Connector filtering logic is correctly implemented and consistent across the codebase

The verification confirms that the connector filtering logic is well-implemented and consistent:

  • The filterConnectors function is only used in walletConnect.tsx and follows clear, predictable logic:
    • Returns only argentMobile connector if in Argent mobile browser
    • Returns all connectors for desktop
    • Filters out argentX on mobile devices
  • The implementation is supported by comprehensive test coverage in connectorWrapper.test.js
  • The filtering works in conjunction with sortConnectors which properly orders available connectors first
  • The connector configuration in connectorWrapper.ts aligns with the filtering logic, properly defining all supported wallet types
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other uses of filterConnectors to ensure consistent behavior
rg -A 5 "filterConnectors" --type typescript

# Search for tests related to connector filtering
rg -l "filterConnectors.*test" --type typescript

Length of output: 165


Script:

#!/bin/bash
# Search for other uses of filterConnectors without file type restriction
rg -A 5 "filterConnectors"

# Search for tests related to connector filtering
rg -l "filterConnectors.*test"

# Search for connector-related files
fd -e ts -e tsx "connector|wallet"

Length of output: 1143


Script:

#!/bin/bash
# Check the implementation of sortConnectors and related wallet logic
cat components/UI/walletConnect.tsx

# Check connector wrapper implementation
cat utils/connectorWrapper.ts

# Look for any connector configuration or setup
rg "Connector" -A 5

Length of output: 61632

components/identities/identitiesGalleryV1.tsx (1)

76-78: Improved UI/UX for domain expiration warnings

The changes enhance the user experience through:

  • More actionable tooltip text that guides users to renew
  • Consistent iconography using RenewalIcon
  • Clear visual hierarchy with red for expired and yellow for expiring soon domains

Also applies to: 88-89

🧰 Tools
🪛 Biome (1.9.4)

[error] 76-76: Expected an expression, or an assignment but instead found '?'.

Expected an expression, or an assignment here.

(parse)


[error] 77-78: Expected an expression for the left hand side of the >>> operator.

This operator requires a left hand side value

(parse)


[error] 78-78: Expected an expression but instead found '>>>'.

Expected an expression here.

(parse)


[error] 78-78: Expected an expression but instead found '>'.

Expected an expression here.

(parse)


[error] 78-78: expected , but instead found :

Remove :

(parse)

utils/connectorWrapper.ts (1)

Line range hint 1-40: LGTM! Connector setup and imports are well-structured.

The connector configuration is properly implemented with appropriate imports and environment variable usage.

Comment on lines 72 to 89
<<<<<<< HEAD
? "This domain is expired"
: `Be careful, this domain will expire on ${timestampToReadableDate(
=======
? "This domain has expired! Renew it now to keep using it."
: `This domain will expire on ${timestampToReadableDate(
>>>>>>> e09c027 (Fix: Add distinct warning for expired domains)
identity?.domain_expiry ?? 0
)}`
}
arrow
>
<<<<<<< HEAD
<ErrorIcon color="error" />
=======
{/* <ErrorIcon color="error" /> */}
<RenewalIcon color={isIdentityExpired(identity) ? "#FF3333" : "#FFDE21"} width="12" />
>>>>>>> e09c027 (Fix: Add distinct warning for expired domains)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Resolve merge conflicts before merging

There are unresolved merge conflicts in the code. The conflicts involve changes to the tooltip text and icon for expired domains. Please resolve these conflicts by choosing the appropriate version:

  1. Original version:

    • Message: "This domain is expired"
    • Icon: ErrorIcon in red
  2. New version:

    • Message: "This domain has expired! Renew it now to keep using it."
    • Icon: RenewalIcon with conditional color
🧰 Tools
🪛 Biome (1.9.4)

[error] 72-72: Expected an expression but instead found '<<'.

Expected an expression here.

(parse)


[error] 72-72: Expected an expression but instead found '<<'.

Expected an expression here.

(parse)


[error] 73-74: Expected a JSX attribute but instead found '? "This domain is expired"
: `'.

Expected a JSX attribute here.

(parse)


[error] 74-74: Expected a JSX attribute but instead found ', this'.

Expected a JSX attribute here.

(parse)


[error] 74-74: expected ... but instead found timestampToReadableDate

Remove timestampToReadableDate

(parse)


[error] 74-75: Expected an expression for the left hand side of the === operator.

This operator requires a left hand side value

(parse)


[error] 75-75: Expected an expression but instead found '==='.

Expected an expression here.

(parse)


[error] 75-75: Expected an expression but instead found '='.

Expected an expression here.

(parse)


[error] 74-75: Invalid assignment to ======

This expression cannot be assigned to

(parse)


[error] 76-76: Expected an expression, or an assignment but instead found '?'.

Expected an expression, or an assignment here.

(parse)


[error] 77-78: Expected an expression for the left hand side of the >>> operator.

This operator requires a left hand side value

(parse)


[error] 78-78: Expected an expression but instead found '>>>'.

Expected an expression here.

(parse)


[error] 78-78: Expected an expression but instead found '>'.

Expected an expression here.

(parse)


[error] 78-78: expected , but instead found :

Remove :

(parse)


[error] 79-79: expected , but instead found identity

Remove identity

(parse)


[error] 83-84: Expected a JSX Expression, a Element, or a text but instead found '<<<<<<'.

Expected a JSX Expression, a Element, or a text here.

(parse)


[error] 85-85: expected , but instead found color

Remove color

(parse)


[error] 85-85: expected , but instead found =

Remove =

(parse)


[error] 85-86: Expected a JSX attribute but instead found '======='.

Expected a JSX attribute here.

(parse)


[error] 87-87: expected ... but instead found }

Remove }

(parse)


[error] 88-88: expected > but instead found <

Remove <

(parse)


[error] 84-87: Expected corresponding JSX closing tag for 'HEAD'.

Opening tag

closing tag

(parse)


[error] 72-83: Expected corresponding JSX closing tag for 'HEAD'.

Opening tag

closing tag

(parse)


[error] 88-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 89-89: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 74-75: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Comment on lines 309 to 313
<<<<<<< HEAD
href={process.env.NEXT_PUBLIC_STARKNET_ID as string}
=======
href={ `${process.env.NEXT_PUBLIC_STARKNET_ID as string}` }
>>>>>>> e09c027 (Fix: Add distinct warning for expired domains)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Resolve merge conflict markers

There's an unresolved merge conflict in the code. The conflict markers (<<<<<<< HEAD, =======, >>>>>>>) need to be removed, and the correct version needs to be selected.

Remove the conflict markers and choose one of these versions:

- <<<<<<< HEAD
-                     href={process.env.NEXT_PUBLIC_STARKNET_ID as string}
- =======
-                     href={ `${process.env.NEXT_PUBLIC_STARKNET_ID as string}` }
- >>>>>>> e09c027 (Fix: Add distinct warning for expired domains)
+                     href={process.env.NEXT_PUBLIC_STARKNET_ID as string}

Note: The change to wrap the environment variable in a template literal (${...}) appears unnecessary as it doesn't affect the string's value. Additionally, this change seems unrelated to the PR's objective of adding warnings for expired domains.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<<<<<<< HEAD
href={process.env.NEXT_PUBLIC_STARKNET_ID as string}
=======
href={ `${process.env.NEXT_PUBLIC_STARKNET_ID as string}` }
>>>>>>> e09c027 (Fix: Add distinct warning for expired domains)
href={process.env.NEXT_PUBLIC_STARKNET_ID as string}
🧰 Tools
🪛 Biome (1.9.4)

[error] 309-309: Expected a type parameter but instead found '<<<<<<'.

Expected a type parameter here.

(parse)


[error] 309-309: expected , but instead found HEAD

Remove HEAD

(parse)


[error] 310-310: expected , but instead found href

Remove href

(parse)


[error] 310-310: expected , but instead found =

Remove =

(parse)


[error] 310-310: expected , but instead found process

Remove process

(parse)


[error] 310-310: expected , but instead found as

Remove as

(parse)


[error] 310-310: expected , but instead found string

Remove string

(parse)


[error] 310-310: expected , but instead found }

Remove }

(parse)


[error] 310-311: expected , but instead found ===

Remove ===

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)


[error] 313-313: Unexpected token. Did you mean {'>'} or &gt;?

(parse)

@emarc99 emarc99 marked this pull request as draft November 28, 2024 22:33
@fricoben
Copy link
Contributor

wen ready ? @emarc99

@emarc99
Copy link
Contributor Author

emarc99 commented Dec 1, 2024

I am still working on it, trying to detect where errors occur by passing statically-generated domain_expiry values in precise format as the response from api.starknet.id and using relevant functions within the project.

Will make a PR soon, please.

wen ready ? @emarc99

@fricoben
Copy link
Contributor

fricoben commented Dec 2, 2024

I am still working on it, trying to detect where errors occur by passing statically-generated domain_expiry values in precise format as the response from api.starknet.id and using relevant functions within the project.

need to finish asap for OD hack

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Doesn't work for me.
The aim of the issue is just to show the red warning icon on every expired domain. Where currently there are some domains that show as expired, and other that doesn't, even though they are expired. You can check on my screenshot, the "TESTET.STARK" domain should show as expired.
You can try to mock with my address if it can help you: 0x05F1F8De723d8117daA26ec24320d0EacabC53a3D642Acb0880846486e73283a
Screenshot 2024-12-05 at 11 44 36 PM

identity?.domain_expiry ?? 0
)}`
}
arrow
>
<ErrorIcon color="error" />
{/* <ErrorIcon color="error" /> */}
<RenewalIcon color={isIdentityExpired(identity) ? "#FF3333" : "#FFDE21"} width="12" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are you changing the icon ? Also the hover tooltip doesn't work for me on your PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll make sure the requested changes are applied, and try the mock address, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

curl https://api.starknet.id/renewal/get_non_subscribed_domains?addr=0x05F1F8De723d8117daA26ec24320d0EacabC53a3D642Acb0880846486e73283a
gives below result
["testapple.stark","sdfsdqdsd.stark","testniin.stark","qzdqsddqz.stark","test5.stark","niko.stark","dsqqsdsqds.stark","testnico.stark","testnicooo.stark"]

Copy link
Collaborator

Choose a reason for hiding this comment

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

curl https://api.starknet.id/renewal/get_non_subscribed_domains?addr=0x05F1F8De723d8117daA26ec24320d0EacabC53a3D642Acb0880846486e73283a gives below result ["testapple.stark","sdfsdqdsd.stark","testniin.stark","qzdqsddqz.stark","test5.stark","niko.stark","dsqqsdsqds.stark","testnico.stark","testnicooo.stark"]

Yes, because it returns the domains that are not subscribed to auto renewal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously, the ones from response have the red icon from the image you shared. "TESTET.STARK" is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

curl https://api.starknet.id/renewal/get_non_subscribed_domains?addr=0x05F1F8De723d8117daA26ec24320d0EacabC53a3D642Acb0880846486e73283a gives below result ["testapple.stark","sdfsdqdsd.stark","testniin.stark","qzdqsddqz.stark","test5.stark","niko.stark","dsqqsdsqds.stark","testnico.stark","testnicooo.stark"]

Yes, because it returns the domains that are not subscribed to auto renewal.

So, can I change this to get all domains, then filter to get expired ones for showing red for expired and yellow for expiring soon?
Basically, I am asking if I can use another api edpoint apart from /renewal/get_non_subscribed_domains? to achieve my task? I am thinking of using /addr_to_full_ids?addr= for expired/expiring soon and /renewal/get_non_subscribed_domains? for renew subscription indicator.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Obviously, the ones from response have the red icon from the image you shared. "TESTET.STARK" is missing.

No, e.g.: niko.stark is not expired but is returned by this route as I disabled the autorenewal for it
image

Please don't use this route, it has nothing to do with the issue

Copy link
Collaborator

Choose a reason for hiding this comment

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

After studying api.starknet.id/src/endpoints/renewal /get_non_subscribed_domains.rs The renewal/get_non_subscribed_domains response, filters out some expired domains based on their renewal status. This means even though they are expired, they are not considered "non-subscribed"

Yes but that's not what we want

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just use the expiry of each domain to determine if it's expired, and then show the red icon to tell the user it's expired

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome, thanks!

@Marchand-Nicolas Marchand-Nicolas added the ❌ Change request Change requested from reviewer label Dec 5, 2024
@emarc99
Copy link
Contributor Author

emarc99 commented Dec 17, 2024

@Marchand-Nicolas please help test. I tested by mocking your public address.
image

<ErrorIcon color="error" />
</Tooltip>
</div>
) : isExpiringSoon ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here it should be isExpiringSoon && needAutoRenewal?.includes(identity.domain)

Because we don't want to tell the user it'll expire soon if they enabled auto renewal (as it'll be renewed automatically)

@emarc99 emarc99 changed the title Fix #924 Fix #924 - some expiring domains not showing as expired Dec 17, 2024
Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Lgtm!

@Marchand-Nicolas Marchand-Nicolas merged commit 9182a1a into lfglabs-dev:testnet Dec 17, 2024
1 of 3 checks passed
@emarc99 emarc99 deleted the fix-#924 branch December 17, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❌ Change request Change requested from reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On /identities I have expired domains that don't seem expired
3 participants