# News: LIFF v2.8.0 released

LIFF v2.8.0 released

We've released LIFF v2.8.0.

These bugs have been fixed in LIFF v2.8.0.

There are no feature changes or additions.

# Fixed bug of liff.init() being resolved before being redirected to a secondary redirect URL

In versions earlier than LIFF v2.7.1, there was a bug of liff.init() being resolved before being redirected to the secondary redirect URL. Because of this bug, there would be duplicate processing of the then() method, once before and once after being redirected to the secondary redirect URL.

In the code example below, the alert liff.init() is resolved. is displayed twice, because liff.init() is resolved once each, before and after being redirected to the secondary redirect URL.

Code sample for displaying alerts when liff.init() is resolved:

liff.init(myLiffId).then(() => {
    // This process is executed after liff.init() is resolved.
    window.alert('liff.init() is resolved.');
});

Because in LIFF v2.8.0, liff.init() is resolved for the first time after being redirected to a secondary redirect URL, duplicate processing of the then() method has been fixed. In the code sample above, an alert is displayed only once.

LIFF Version Timing when liff.init() is resolved
v2.7.1 or earlier resolve-timing-v2-7-0
v2.8.0 resolve-timing-v2-8-0

# Fixed bug of unintentional decoding of URL encoded query parameters

In versions earlier than LIFF v2.7.1, if a developer gave the LIFF URL a URL encoded query paramenter (example:?t=http%3A%2F%2Fexample.com), the query paramenter was decoded when being redirected (example:?t=http://example.com). As a result, it would lead to a secondary redirect URL unintended by the developer.

In LIFF v2.8.0, query parameters aren't decoded but redirected remaining URL encoded.

Redirect flow when you open the LIFF URL https://liff.line.me/{liffId}?t=http%3A%2F%2Fexample.com:

LIFF Version Primary redirect URL Secondary redirect URL
v2.7.1 or earlier https://endpoint.example.jp/?liff.state=
?t=http%3A%2F%2Fexample.com
https://endpoint.example.jp/
?t=http://example.com
v2.8.0 https://endpoint.example.jp/?liff.state=
%3Ft%3Dhttp%253A%252F%252Fexample.com
https://endpoint.example.jp/
?t=http%3A%2F%2Fexample.com
LIFF URL that contains a query parameter

When using LIFF URLs with URL encoded query parameters, upgrade to v2.8.0 to avoid unintended redirections to URLs.

For more information on redirects on LIFF apps, see Behaviors from accessing the LIFF URL to opening the LIFF app in the LIFF documentation.