Home

>

Tools

>

Strapi

>

Releases

>

1.5.4

Strapi Release: 1.5.4

Tag Name: v1.5.4

Release Date: 1/19/2016

Strapi LogoStrapi

Open-source headless CMS built with Node.js. Provides developers with complete freedom in choosing their favorite tools and frameworks for frontend development.

TL;DR

Strapi v1.5.4 removes the hook timeout feature as it was environment-dependent and couldn't be reliably controlled. This change simplifies the hook system by eliminating an unpredictable constraint that could cause issues in various deployment environments.

Highlight of the Release

    • Removed environment-dependent hook timeout feature
    • Improved consistency across different deployment environments
    • Simplified hook system behavior

Migration Guide

Migrating from v1.5.3 to v1.5.4

If you were relying on the hook timeout feature to limit execution time of hooks:

  1. Review any code that might have depended on hook timeouts being enforced
  2. Consider implementing your own timeout mechanisms if necessary:
    • For async functions, you can use Promise.race() with a timeout promise
    • For synchronous operations, consider refactoring to async patterns with timeouts

Example of custom timeout implementation:

const withTimeout = (promise, timeoutMs) => {
  let timeoutId;
  const timeoutPromise = new Promise((_, reject) => {
    timeoutId = setTimeout(() => {
      reject(new Error(`Operation timed out after ${timeoutMs}ms`));
    }, timeoutMs);
  });

  return Promise.race([
    promise,
    timeoutPromise
  ]).finally(() => {
    clearTimeout(timeoutId);
  });
};

// Usage
try {
  await withTimeout(yourHookFunction(), 5000);
} catch (error) {
  // Handle timeout or other errors
}

Upgrade Recommendations

This is a minor update that removes a potentially problematic feature. It's recommended to upgrade to v1.5.4 if you've experienced any issues with hook timeouts in different environments.

The upgrade should be straightforward with minimal risk, as it removes a constraint rather than adding new requirements. However, if you were explicitly relying on hook timeouts to limit execution time, you should implement your own timeout mechanisms as outlined in the migration guide.

Bug Fixes

Hook Timeout Removal

The hook timeout feature has been removed as it was causing inconsistent behavior across different environments. The timeout was environment-dependent and couldn't be reliably controlled, leading to unpredictable application behavior.

This change makes the hook system more reliable by removing a constraint that was difficult to manage across various deployment scenarios.

New Features

No new features were added in this release.

Security Updates

No security fixes were included in this release.

Performance Improvements

No specific performance improvements were included in this release.

Impact Summary

This release focuses on improving reliability by removing the environment-dependent hook timeout feature. The change addresses inconsistencies that could occur when deploying Strapi applications across different environments where timeout behavior might vary.

By removing this constraint, Strapi provides a more predictable development experience, especially for teams working across multiple environments or deploying to various cloud platforms. While this change is relatively small in scope, it represents an important step toward making Strapi more environment-agnostic and reliable.

Developers who were relying on hook timeouts to limit execution time will need to implement their own timeout mechanisms, but most users will benefit from more consistent behavior without any required changes to their code.

Full Release Notes

  • Removed hook timeout since it depends a lot on the environment and we can't control this.

Statistics:

File Changed2
Line Additions1
Line Deletions12
Line Changes13
Total Commits2

User Affected:

  • No longer need to worry about hook timeouts causing unexpected failures in different environments
  • May need to implement their own timeout mechanisms if they relied on this feature
  • Will experience more consistent behavior across different deployment environments

Contributors: