{ "id": "175917", "key": "TIMOB-28293", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21177", "name": "Release 9.3.1", "archived": false, "released": true, "releaseDate": "2021-01-26" } ], "resolution": null, "resolutiondate": null, "created": "2020-12-17T15:23:27.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ListView", "android", "marker", "regression" ], "versions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-01-07T20:37:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5.Description\r\n\r\nWhen calling setMarker with an itemIndex or sectionIndex value that is greater than the total items or sections an error like below is thrown. This did not occur in 9.2.2.GA\r\n\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [76,76] /app.js:12\r\n[ERROR] TiExceptionHandler: listView.addMarker({\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: Error: Index: 1, Size: 1\r\n[ERROR] TiExceptionHandler: at /app.js:12:10\r\n[ERROR] TiExceptionHandler: at Module._runScript (ti:/module.js:587:9)\r\n[ERROR] TiExceptionHandler: at Module.load (ti:/module.js:106:7)\r\n[ERROR] TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:436:9)\r\n[ERROR] TiExceptionHandler: at Module.loadAsFile (ti:/module.js:488:15)\r\n[ERROR] TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:410:20)\r\n[ERROR] TiExceptionHandler: at Module.require (ti:/module.js:239:23)\r\n[ERROR] TiExceptionHandler: at Module.global.Module.require (:5050:34)\r\n[ERROR] TiExceptionHandler: at require (ti:/module.js:550:15)\r\n[ERROR] TiExceptionHandler: at global.require (:5034:10)\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: java.util.ArrayList.get(ArrayList.java:437)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.listview.ListViewProxy.getSectionByIndex(ListViewProxy.java:207)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.listview.ListViewProxy.addMarker(ListViewProxy.java:72)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:172)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiApplication.launch(TiApplication.java:872)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadScript(TiLaunchActivity.java:96)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.loadScript(TiRootActivity.java:500)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onResume(TiLaunchActivity.java:177)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.onResume(TiRootActivity.java:519)\r\n[ERROR] V8Exception: Exception occurred at /app.js:12: Uncaught Error: Index: 1, Size: 1\r\n{code}\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'gray' });\r\nvar listView = Ti.UI.createListView();\r\nvar sections = [];\r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables' });\r\nvar vegDataSet = [\r\n {properties: { title: 'Carrots'}},\r\n {properties: { title: 'Potatoes'}},\r\n];\r\nvegSection.items = vegDataSet;\r\nsections.push(vegSection);\r\nlistView.sections = sections;\r\nlistView.addMarker({\r\n\titemIndex: 0,\r\n\tsectionIndex: 1\r\n});\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Add the code below to an existing app.js\r\n2. Run on Android\r\n\r\nh5.Actual\r\n\r\nRuntime error and RSOD\r\n\r\nh5.Expected\r\n\r\n-Maybe a warning log given that technically this is an error case?- <- This is wrong, see comment\r\n\r\nMarker should be setup and work correctly", "attachment": [ { "id": "67754", "filename": "ListViewMarkerTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-17T20:34:25.000+0000", "size": 1430, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Setting a ListView marker out of bounds throws an exception", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": null, "closedSprints": [ { "id": 1212, "state": "closed", "name": "2020 Sprint 25", "startDate": "2020-12-07T22:11:00.000Z", "endDate": "2020-12-18T22:11:00.000Z", "completeDate": "2020-12-18T16:35:34.544Z", "originBoardId": 114 }, { "id": 1213, "state": "closed", "name": "2020 Sprint 26", "startDate": "2020-12-21T16:40:00.000Z", "endDate": "2021-01-08T16:40:00.000Z", "completeDate": "2021-01-08T17:37:31.799Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "457925", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Did some testing on 9.2.2.GA and it appears that setting a marker that doesn't exist yet works totally fine, and will work correctly when it exists in future. With the below code, after adding a new section and scrolling to the bottom the marker event will have fired\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'gray' });\r\nvar btn = Ti.UI.createButton({ title: 'click', top: 35 });\r\nbtn.addEventListener('click', () => {\r\n\tlistView.appendSection(Ti.UI.createListSection({\r\n\t\theaderTitle: 'added after click',\r\n\t\titems: addRows(50)\r\n\t}));\r\n});\r\nwin.add(btn);\r\nvar listView = Ti.UI.createListView({ top: 100 });var sections = [];\r\n\r\nsections.push(Ti.UI.createListSection({\r\n\theaderTitle: 'Fruits',\r\n\titems: addRows(100)\r\n}));\r\n\r\nlistView.sections = sections;\r\nwin.add(listView);\r\nwin.open();\r\n\r\nlistView.addMarker({\r\n\titemIndex: 25,\r\n\tsectionIndex: 1\r\n});\r\n\r\nlistView.addEventListener('marker', (e) => {\r\n\tconsole.log('marker fired');\r\n});\r\n\r\nfunction addRows(total) {\r\n\tconst arr = [];\r\n\tfor (let i = 0; i < total; i++) {\r\n\t\tarr.push({ \r\n\t\t\tproperties: {\r\n\t\t\t\ttitle: `Label = ${i}`\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\treturn arr;\r\n}\r\n\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-12-17T15:36:33.000+0000", "updated": "2020-12-17T15:36:33.000+0000" }, { "id": "457927", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/12350", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-17T17:33:36.000+0000", "updated": "2020-12-17T17:33:36.000+0000" }, { "id": "457928", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The below test script is a practical use-case for ListView markers where when you scroll to the bottom, it loads more rows, and when you scroll to the bottom again it loads more rows. It doesn't test for the bug mentioned on this ticket, but it is another common way of implementing markers.\r\n [^ListViewMarkerTest.js] ", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-17T20:36:25.000+0000", "updated": "2020-12-17T20:36:25.000+0000" }, { "id": "457973", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for Jenkins build.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-05T23:28:41.000+0000", "updated": "2021-01-05T23:28:41.000+0000" }, { "id": "457985", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, backport for 9_3_X merged to 9.3.1 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-01-07T19:53:40.000+0000", "updated": "2021-01-07T20:37:31.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }