Skip to content

Maintainence Update#325

Merged
n-ce merged 10 commits into
mainfrom
v8
Jun 10, 2025
Merged

Maintainence Update#325
n-ce merged 10 commits into
mainfrom
v8

Conversation

@n-ce
Copy link
Copy Markdown
Owner

@n-ce n-ce commented Jun 10, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of missing audio codec information for streams, ensuring better fallback behavior.
    • Enhanced video playback queue logic to handle cases with missing saved watch modes more gracefully.
  • Improvements

    • Expanded support for audio streams by including an additional itag value for the "opus" codec in medium quality.
    • Updated environment variable access methods for improved compatibility.
  • Chores

    • Upgraded a development dependency for edge functions to a newer version.

JKzeta and others added 9 commits June 1, 2025 22:03
Currently translated at 97.0% (163 of 168 strings)

Translation: ytify/web
Translate-URL: https://hosted.weblate.org/projects/ytify/web/es/
* Update linkPreview.ts

* Update fallback.ts

* Update package.json

* Update fallback.ts

* Update linkPreview.ts

---------

Co-authored-by: Sunil Gupta <sunilk98850@gmail.com>
Translations update from Hosted Weblate
@n-ce n-ce linked an issue Jun 10, 2025 that may be closed by this pull request
25 tasks
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 10, 2025

Walkthrough

The changes update environment variable access in two Netlify edge functions to use process.env instead of Netlify.env.get, adding an explicit error check in one. The @netlify/edge-functions package is upgraded. Video queue handling in the WatchVideo component is refined, a fallback mechanism for audio codec detection is added, and an additional itag is included in the preferred audio stream utility.

Changes

File(s) Change Summary
netlify/edge-functions/fallback.ts,
netlify/edge-functions/linkPreview.ts
Switched environment variable access from Netlify.env.get to process.env; added error throw if missing in fallback.ts.
package.json Updated @netlify/edge-functions devDependency from ^2.12.0 to ^2.14.5.
src/components/WatchVideo.ts Refined video queue handling logic on video end; adjusted footer text formatting.
src/lib/utils.ts Added itag 251 to the "medium" quality "opus" codec array in preferredStream.
src/modules/getStreamData.ts Added fallback for audio codec detection: infers codec from MIME type if encoding is missing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WatchVideoComponent
    participant QueueList

    User->>WatchVideoComponent: Video ends
    alt Queue has children AND savedQ exists
        WatchVideoComponent->>QueueList: Trigger click on first child
    else
        WatchVideoComponent->>WatchVideoComponent: Close dialog
    end
Loading
sequenceDiagram
    participant getStreamData
    participant InvidiousAPI

    getStreamData->>InvidiousAPI: Fetch stream data
    InvidiousAPI-->>getStreamData: Return stream info
    alt v.encoding exists
        getStreamData->>getStreamData: Set codec = v.encoding
    else
        alt type includes "webm"
            getStreamData->>getStreamData: Set codec = "opus"
        else
            getStreamData->>getStreamData: Set codec = "aac"
        end
    end
Loading

Poem

A bunny hops through fields of code,
With env vars changed, the functions strode.
A queue that plays with gentle care,
New codecs found with wisdom rare.
Packages fresh, the streams now sing,
Oh what delight these tweaks do bring!
🐇✨


📜 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 cb9d8b5 and 880ca84.

📒 Files selected for processing (1)
  • netlify/edge-functions/fallback.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • netlify/edge-functions/fallback.ts
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

@n-ce n-ce removed a link to an issue Jun 10, 2025
25 tasks
@n-ce n-ce linked an issue Jun 10, 2025 that may be closed by this pull request
Copy link
Copy Markdown
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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bd0a0ad and cb9d8b5.

📒 Files selected for processing (6)
  • netlify/edge-functions/fallback.ts (1 hunks)
  • netlify/edge-functions/linkPreview.ts (1 hunks)
  • package.json (1 hunks)
  • src/components/WatchVideo.ts (2 hunks)
  • src/lib/utils.ts (1 hunks)
  • src/modules/getStreamData.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/WatchVideo.ts (2)
src/lib/dom.ts (1)
  • queuelist (21-21)
src/lib/store.ts (1)
  • store (65-155)
🔇 Additional comments (6)
src/lib/utils.ts (1)

65-65: LGTM! Expanding medium quality opus itag options.

Adding itag 251 to the medium quality opus array provides more flexibility in stream selection while maintaining the existing preference order.

src/modules/getStreamData.ts (1)

53-53: Excellent fallback mechanism for codec detection.

The conditional logic provides robust codec assignment when the encoding field is missing or falsy. Inferring opus for webm and aac for other formats is a sound approach that aligns with typical container-codec pairings.

src/components/WatchVideo.ts (2)

87-88: Improved queue handling with user preference consideration.

The additional savedQ condition ensures that auto-advancement to the next queue item only occurs when the user has enabled watch mode. This respects user preferences and prevents unwanted auto-play behavior.


185-187: Good formatting improvement for readability.

Splitting the long informational text across multiple lines improves code readability without changing the content.

netlify/edge-functions/linkPreview.ts (1)

12-12: Consistent environment variable access pattern.

The change is consistent with the pattern used in fallback.ts, which is good for maintainability. The same runtime safety consideration applies here regarding the non-null assertion.

package.json (1)

16-16:

Details

✅ Verification successful

Verify package update compatibility and review changelog.

The package update from ^2.12.0 to ^2.14.5 aligns with the environment variable access changes in the edge functions.

Please verify the compatibility and review the changelog for any other breaking changes:


🌐 Web query:

What are the breaking changes and new features in @netlify/edge-functions versions 2.13.0 through 2.14.5?

💡 Result:

Breaking Changes and New Features in @netlify/edge-functions v2.13.0 to v2.14.5

The official documentation and changelogs for @netlify/edge-functions do not provide a detailed release list directly within the search results. However, based on available data from Netlify’s public changelogs, blog posts, and package information, the following is a summary of notable new features and potential changes introduced in versions 2.13.0 through 2.14.5:

Latest Version:
@netlify/edge-functions v2.14.5 (as of June 10, 2025)[1].


New Features

  • Improved Caching API
    Netlify introduced a Cache API beta, built on web standards, that lets developers cache fetch requests directly within serverless and edge functions. This feature is aimed at improving response times and resilience and works seamlessly with or without frameworks[2].

  • Advanced Error Handling
    Edge Functions now support a configurable onError property. This allows developers to specify how unhandled errors in edge functions are managed—such as showing a custom error page, falling back to a specified route, or skipping the function and continuing the request chain[9].

    Example usage:

    export const config = {
      path: "/external-api",
      onError: "/fallback"
    }
  • Path Exclusion for Edge Functions
    Developers can now explicitly define exclusion paths so that certain URLs (e.g., for static assets) will never trigger edge function execution. This configuration helps prevent unnecessary computation and improves performance, especially for static files and known paths[9][10].

  • Better Local Testing & Debugging
    Enhanced options for local testing of edge functions in different geographic contexts via Netlify CLI with geo-mocking capabilities, including country code overrides for debugging location-based features[6].


Notable Improvements

  • Full Angular 20 Compatibility
    Full support for deploying Angular 20 projects, including SSR improvements, is now integrated with edge network rendering[2].

  • Improved Onboarding and Update Notifications
    Update notifications now include links to release notes and better onboarding guidance is provided within the developer workflow[2].

  • Enhanced Edge Function Order Control
    For nuanced control over function execution order, recommended best practices now include path configuration in netlify.toml[6].


Breaking Changes

The available documentation and changelogs do not indicate specific breaking changes between versions 2.13.0 and 2.14.5. Recent focus has been on introducing additional configuration options, developer ergonomics, and performance optimizations, rather than disruptive changes to the core API[2][9][6]. Always review your own usage and the [npm package changelog][1] before updating, as changes affecting your codebase may still occur in minor or patch releases.


Summary Table: Key Changes v2.13.0 — v2.14.5

Feature/Change Description Source
Cache API (Beta) Enables fetch request caching in edge/serverless functions for faster responses. [2]
Custom onError Handler Edge Functions can specify error handling strategies for unhandled exceptions. [9]
Path Exclusion for Edge Functions Prevents edge function execution for specified static/asset paths. [9][10]
Geolocation and Local Testing Improvements CLI allows geo-mocking for better local simulation of edge functions. [6]
Update Notifications and Docs Easier updates with direct links to release content and clearer onboarding. [2]

Conclusion

From versions 2.13.0 to 2.14.5, @netlify/edge-functions has focused on adding developer features like the Cache API, advanced error handling, and path exclusions, as well as improving developer experience with better local testing and documentation. There are no explicit reports of breaking changes in this release range, but reviewing any package-level changelogs before upgrade is advised[1][2][9][6][10].

Citations:


Approved: @netlify/edge-functions upgraded to ^2.14.5

Changelog review for v2.13.0–v2.14.5 reveals no breaking changes to the core API. Notable new features and improvements include:

  • Cache API (beta) for caching fetch requests in edge functions
  • Configurable onError handlers for custom error pages or fallbacks
  • Path exclusion settings to skip edge functions on specified routes
  • Enhanced local testing with geo-mocking via the Netlify CLI
  • Improved onboarding, update notifications, and Angular 20 SSR support

Please validate your environment configuration and test edge functions (caching behavior, error handling, path rules, geo-mocking) to ensure seamless integration.

Comment thread netlify/edge-functions/fallback.ts Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@n-ce n-ce merged commit ebb3b0f into main Jun 10, 2025
2 checks passed
@n-ce n-ce deleted the v8 branch June 10, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Player stuck at setting up audiostream

2 participants