WAI
Status Update
Comments
ga...@google.com <ga...@google.com>
jb...@google.com <jb...@google.com> #2
Fatal Exception: java.lang.IllegalArgumentException: offset(9) is out of bounds [0, 8]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:593)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.java:442)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:390)
at androidx.compose.foundation.text.TextFieldScrollKt.getCursorRectInScroller(TextFieldScrollKt.java:207)
at androidx.compose.foundation.text.TextFieldScrollKt.access$getCursorRectInScroller(TextFieldScrollKt.java:1)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke(TextFieldScroll.kt:179)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke$bridge(TextFieldScroll.kt:12)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke(TextFieldScroll.kt:178)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke$bridge(TextFieldScroll.kt:27)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
kv...@gmail.com <kv...@gmail.com> #3
It's hard to tackle the issue without a repro, I couldn't reproduce the crash using Compose's demo app.
It would help if you provide a repro, or at least a code of how the text field is used in your app.
sh...@gmail.com <sh...@gmail.com> #4
I havent seen this issue for a couple of weeks now. Perhaps it was fixed thanks to some other set of fixes? Im currently using compose 1.2.0-alpha01.
Beyond that, I have no idea what might have been triggering this. The only thing that stands out to me is that my VisualTransformation also handles cases 0-8, so it could be related to that? Im using one text field composable everywhere (from the design system); but the stack-trace doesnt really point to any specific screen, so I dont think that helps much.
Edit: Seems like I jinxed it, the issue just popped up in my crashlytics logs again this afternoon.
Beyond that, I have no idea what might have been triggering this. The only thing that stands out to me is that my VisualTransformation also handles cases 0-8, so it could be related to that? Im using one text field composable everywhere (from the design system); but the stack-trace doesnt really point to any specific screen, so I dont think that helps much.
Edit: Seems like I jinxed it, the issue just popped up in my crashlytics logs again this afternoon.
mb...@costaisa.com <mb...@costaisa.com> #5
Ive managed to recreate this!
My setup is as follows;
Scaffold contains a pager, and a bottom bar with a couple of text fields. Whenever the page changes, the text is updated to reflect the text thats assigned to the given page.
If I input some text, long press it so that the selection handles are visible, swipe to the next page (which effectively clears the text, and dismisses the selection handle); and then swipe back, the crash happens, presumably because the state has the selection handles visible, but the text no longer being available, hence the out of bounds crash.
My setup is as follows;
Scaffold contains a pager, and a bottom bar with a couple of text fields. Whenever the page changes, the text is updated to reflect the text thats assigned to the given page.
If I input some text, long press it so that the selection handles are visible, swipe to the next page (which effectively clears the text, and dismisses the selection handle); and then swipe back, the crash happens, presumably because the state has the selection handles visible, but the text no longer being available, hence the out of bounds crash.
Description
A short description of the issue:
When using the getFrom() method in a card, the firstname and lastname appears in the return string, but not the email address, counter to what is contained in the GmailMessage.getFrom() documentation:
A small code sample that reliably reproduces the issue. The sample should run as-is or with minimal setup, without external dependencies.
function loadAddOn(event) {
var accessToken = event.messageMetadata.accessToken;
var messageId = event.messageMetadata.messageId;
GmailApp.setCurrentMessageAccessToken(accessToken);
var mailMessage = GmailApp.getMessageById(messageId);
var from = mailMessage.getFrom();
var openDocButton = CardService.newTextButton()
.setText("open docs")
.setOpenLink(
CardService.newOpenLink().setUrl("
var card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle("My First Gmail Addon"))
.addSection(CardService.newCardSection()
.addWidget(CardService.newTextParagraph().setText("The email is from: " + from))
.addWidget(openDocButton))
.build();
return [card];
}
What steps will reproduce the problem?
1. Create a gmail addon with the above code
2. Install the addon to gmail and open a message
What is the expected output? What do you see instead? If you see error messages, please provide them.
The email address should be shown as described in the documentation for the method. What is shown instead, is the name of the sender only.